[Tkinter-discuss] How to automatically run some code upon GUI startup?

2008-04-08 Thread Snakey
I have created a simple Tkinter GUI. I have a function that needs to be executed automatically upon launching the GUI application. How can it be done? -- View this message in context: http://www.nabble.com/How-to-automatically-run-some-code-upon-GUI-startup--tp16547636p16547636.html Sent from

Re: [Tkinter-discuss] How to automatically run some code upon GUI startup?

2008-04-08 Thread Snakey
snakey wrote: > > Hi Fredrik, > Thanks for the suggestion. Let me try it now. I guess I need a deeper > understanding of this mainloop() thing. I am still unclear about how the > whole GUI concept of mainloop() works. > Fredrik Lundh wrote: > > Snakey wrote

Re: [Tkinter-discuss] How to catch when the root window closes?

2008-04-10 Thread Snakey
would think that the root window is exited by using the "X" windows close button? If this is the case, you can bind the window manager event WM_DELETE_WINDOW to a handler. Try this: root = Tk() ... ... some other codes # -- # to bind the window manager's CLOSE event to

[Tkinter-discuss] Open a Dos prompt(cmd.exe) using a GUI, thus allowing user to execute batchfile

2008-04-10 Thread Snakey
I have created a GUI which has a button that when pressed, opens a Dos prompt box. I am using os.system( '.somepath...\.\cmd.exe' ). In this dos box, the user can run watever application he wants eg. execute a batchfile or run dos commands. 1. I need the GUI to monitor this dos box such that

[Tkinter-discuss] How to detech change of variable state in Tk?

2008-04-14 Thread Snakey
I have written a Tk GUI that upon pressing a button, will launch a subprocess to open a dos-box "cmd.exe". I need the GUI to monitor the returncode of this subprocess, so that when the dos box closes with return code 0, a subroutine can be executed to handle this event. BUT while the dos box is

Re: [Tkinter-discuss] Open a Dos prompt(cmd.exe) using a GUI, thus allowing user to execute batchfile

2008-04-15 Thread Snakey
piping is taking place. Can this be done?? I tried >>> s = subprocess.popen( 'cmd.exe', stdout=subprocess.PIPE ) # when the new process ends, I do the following: out = s.stdout.readlines() # i do some string action on out Snakey wrote: > > I have created a GUI which ha

[Tkinter-discuss] how to get all the text from a text widget?

2008-05-05 Thread Snakey
I created a text widget to allow my users to enter some lines of text. Now I need to dump all the text contents into a string variable. How can i do that? -- View this message in context: http://www.nabble.com/how-to-get-all-the-text-from-a-text-widget--tp17053954p17053954.html Sent from the P

[Tkinter-discuss] how to import a module that is not in the work dir?

2008-05-07 Thread Snakey
I have written some functions in "my_functions.py". I need to use these functions in another program main.py. But, "my_functions.py" cannot reside in my local work folder. It resides in a shared directory somewhere else eg. in X:\shared\my_functions.py How can I import my_functions.py into m

Re: [Tkinter-discuss] how to get all the text from a text widget?

2008-05-14 Thread Snakey
Hi Polo, Thanks for the tip! Guilherme Polo wrote: > > Snakey yahoo.com> writes: > >> >> >> I created a text widget to allow my users to enter some lines of text. >> Now I >> need to dump all the text contents into a string variable. How ca