Re: [Tutor] subprocess.Popen.communicate()[]

2006-12-29 Thread Alan Gauld
"Isaac" <[EMAIL PROTECTED]> wrote > Without communicate()[0] the screen is blank and no prompt. Ah. I see. OK, Thanks for clarifying that. I should have tried both versions, I only checked that my version did, in fact, clear the screen, I didn't check how yours behaved - naughty! Alan G. __

Re: [Tutor] subprocess.Popen.communicate()[]

2006-12-28 Thread Isaac
> "Isaac" > > I have the following in my PYTHONSTARTUP file > > > > def clear(): > >x = subprocess.Popen("clear").communicate(None)[0] > >return x > > > > Yes, but can't you simplify this to just: > > > import subprocess > def clear(): > subProcess.Popen('clear') > > if all you want to

Re: [Tutor] subprocess.Popen.communicate()[]

2006-12-28 Thread Alan Gauld
"Isaac" <[EMAIL PROTECTED]> wrote in > I have the following in my PYTHONSTARTUP file > > def clear(): >x = subprocess.Popen("clear").communicate(None)[0] >return x > > Am in correct in my interpretation of the interpreter? Yes, but can't you simplify this to just: import subprocess d

[Tutor] subprocess.Popen.communicate()[]

2006-12-28 Thread Isaac
Hello tutors! I have the following in my PYTHONSTARTUP file def clear(): x = subprocess.Popen("clear").communicate(None)[0] return x so that when I type: clear() at the prompt, my terminal screen clears and I get only my prompt at the top of the screen. without the index at the end of