Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

PyGTK advice and returning data

  • 02-04-2009 10:02AM
    #1
    Closed Accounts Posts: 34


    Hi Guys,

    I'm writing a pygtk program. At the minute it has one button and when you click the button the program executes

    os.system("/home/jack/somscript.sh")

    Lets say all I had in that script was an "ls" command, how do I get the list of directories back into my program.

    Also I'm wondering whats the best GUI designer for this stuff there appears to be a few choices ? I'm using Ubuntu by the way.

    Thanks for any help on this in advance.
    Regards,
    Jack


Comments

  • Registered Users, Registered Users 2 Posts: 85 ✭✭slavigo


    Hey,
    If you have a look at
    os.popen instead of os.system
    a = os.popen('/home/jack/somscript.sh')
    print a.read()
    

    Hope it's what your looking for.
    Dave.


  • Closed Accounts Posts: 34 jackofnotrades


    that looks like good stuff I'm gona try it out thanks


Advertisement