Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

PyGTK advice and returning data

Options
  • 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 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