[Tkinter-discuss] Dynamic output of "DOS" command in tkinter
AbsoluteMatt
mattx_13 at hotmail.com
Fri Apr 25 10:57:44 CEST 2008
Hi Martin,
Thanks for your reply, I actually started trying to do this with popen, but
didn't pursue it as I wasn't sure that it would work this way. Now that you
have confirmed that it can be done like this, I will continue on this path
(and will read up on subprocess etc as well :-)). Thinking about it my
question would have probably sat better in a python forum, but I got the
answer/direction I needed so no regrets.
Cheers,
Matt
Martin Franklin wrote:
>
> AbsoluteMatt wrote:
>> Hi Guys,
>>
>> This is my first post here and my first time developing a tkinter app -
>> so
>> please go easy:-) I have to say I have found it really nice so far, but
>> am
>> struggling on one point.
>>
>> What I want to be able to do is take a system command and "pipe" it to a
>> scrollable window, however I would like it to follow the execution of the
>> command dynamically. The command that I am running is not one that will
>> execute in a few seconds allowing me to send the result to a scrollable
>> window - which I understand how to do.
>> The link below shows an example of someone doing this:
>> http://mail.python.org/pipermail/python-list/2004-September/281344.html
>>
>> What I am actually doing is running an oracle IMP command and would like
>> to
>> follow the imported tables/rows etc from the app
>>
>> Any suggestion about how to display in this way do this would be much
>> appreciated.
>>
>> Many Thanks,
>>
>> Matt
>>
>>
>
> Hi Matt,
>
> this is not so much a tkinter problem, more a subprocess / popen thing :)
>
> I've done this in the past with a simple while 1: loop...
>
>
> proc = os.popen("imp big_oracle_xport_file.exp")
>
> while 1:
> line = proc.readline()
> if not line:
> break
> textBox.write(line)
>
> of course this will block and wait for the command to write another line
> to stdout... I'm sure there are better ways to do this by now, its been
> a while since I looked at the popen family (subprocess module now too I
> think...?) in any case the main python list would be my next stop after
> I checked the python doc's for popen, subprocess, command etc etc :)
>
> Cheers
> Martin
>
> --
> signature file not found, must be something I ate
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
>
>
--
View this message in context: http://www.nabble.com/Dynamic-output-of-%22DOS%22-command-in-tkinter-tp16849178p16893325.html
Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.
More information about the Tkinter-discuss
mailing list