Skip to main content

Thread: Help with Pygtk button


i'm build simple pygtk window , still learning go. want have button execute shell script when clicked. please give me example of how , please include comments in example explain it.

in advanced any 1 can give.

you can find lots , lots of tutorials online on pygtk , how create window , widgets such buttons, more sufficient.

executing script can use subprocess.popen.

code:
// include subprocess module import subprocess  function exec_script():    // need pass command array    cmd = ['sh', 'path/to/script.sh']     // run script    process = subprocess.popen(cmd)
i'm taking thin air.. reserve myself errors... subprocess has lots of functionality, 1 can play around lot module.

option creating gtk-applications use start of application. play around applications interface in graphical enviroment using glade. in case need install it.

code:
sudo apt-get install quickly
then start new project with:

code:
quickly create ubuntu-application <name-of-project>
beforehand, might wanna cd (change directory) in terminal @ create application, typing command @ once create folder in homedir containing project. if (just example) projectfolder in homefolder, create new folder with:

code:
mkdir projects cd projects
then run create... command above create project in directory ~/projects

find more documentation on quickly here

best of luck!


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Help with Pygtk button


Ubuntu

Comments

Popular posts from this blog

Thread: Can not create raid array: mdadm: no raid-devices specified.

Thread: HOW TO: Package and theme GTK+ / Gtkmm apps in Linux for Windows

Thread: Twinview issues