Re: [Tutor] commands

2010-03-28 Thread Dave Angel
Shurui Liu (Aaron Liu) wrote: # Translate wrong British words #Create an empty file print "\nReading characters from the file." raw_input("Press enter then we can move on:") text_file = open("storyBrit.txt", "r+") whole_thing = text_file.read() print whole_thing raw_input("Press enter then we ca

[Tutor] commands

2010-03-28 Thread Shurui Liu (Aaron Liu)
# Translate wrong British words #Create an empty file print "\nReading characters from the file." raw_input("Press enter then we can move on:") text_file = open("storyBrit.txt", "r+") whole_thing = text_file.read() print whole_thing raw_input("Press enter then we can move on:") print "\nWe are gon

Re: [Tutor] commands versus subprocess, I'm confused

2008-12-26 Thread Reed O'Brien
On Dec 26, 2008, at 8:57, "Emad Nawfal (عماد نوفل)" mail.com> wrote: 2008/12/26 Kent Johnson On Fri, Dec 26, 2008 at 8:09 AM, Emad Nawfal (عماد نوفل) wrote: > suppose I have an external program that prints "testing the subprocess > module" > I know I can run it through the commands module

Re: [Tutor] commands versus subprocess, I'm confused

2008-12-26 Thread Alan Gauld
"Emad Nawfal (عماد نوفل)" wrote proc = subprocess.Popen('python3.0 hello.py', shell=True, stdout=subprocess.PIPE, ) stdout_value = proc.communicate()[0] Thank you Kent. It works, but isn't the commands module much simpler? I

Re: [Tutor] commands versus subprocess, I'm confused

2008-12-26 Thread Emad Nawfal (عماد نوفل)
2008/12/26 Kent Johnson > On Fri, Dec 26, 2008 at 8:09 AM, Emad Nawfal (عماد نوفل) > wrote: > > suppose I have an external program that prints "testing the subprocess > > module" > > I know I can run it through the commands module like this: > > > a = commands.getoutput("python3.0 hello.py"

Re: [Tutor] commands versus subprocess, I'm confused

2008-12-26 Thread Kent Johnson
On Fri, Dec 26, 2008 at 8:09 AM, Emad Nawfal (عماد نوفل) wrote: > suppose I have an external program that prints "testing the subprocess > module" > I know I can run it through the commands module like this: > a = commands.getoutput("python3.0 hello.py") a > 'testing the subprocess modul

[Tutor] commands versus subprocess, I'm confused

2008-12-26 Thread Emad Nawfal (عماد نوفل)
Hello Tutors, and Happy New Year and Holidays, suppose I have an external program that prints "testing the subprocess module" I know I can run it through the commands module like this: >>> a = commands.getoutput("python3.0 hello.py") >>> a 'testing the subprocess module' >>> len(a) 29 >>> b = a.sp

Re: [Tutor] commands module

2007-12-06 Thread ds
Evert Rol wrote: >> So, I tried setting COLUMNS equal to 500 (arbitrarily large) prior to >> going into python. It seems to change back to 158 automatically >> however. >> For example, when I go into python, import commands, and execute >> commands.getoutput('set') I find that COLUMNS is back to 1

Re: [Tutor] commands module (Forwarded back to list)

2007-12-06 Thread Evert Rol
> So, I tried setting COLUMNS equal to 500 (arbitrarily large) prior to > going into python. It seems to change back to 158 automatically > however. > For example, when I go into python, import commands, and execute > commands.getoutput('set') I find that COLUMNS is back to 158. So, I > think m

Re: [Tutor] commands module (Forwarded back to list)

2007-12-06 Thread ds
Evert Rol wrote: >> >> I've been trying to do something that I thought was going to be >> >> relatively straight-forward, but so far I haven't found a good solution. >> >> >> >> What I'm trying to do is discover a pid on a process and kill it. The >> >> way that I thought that I could do it is so

Re: [Tutor] commands module

2007-12-06 Thread Evert Rol
> I've been trying to do something that I thought was going to be > relatively straight-forward, but so far I haven't found a good > solution. > > What I'm trying to do is discover a pid on a process and kill it. The > way that I thought that I could do it is something along the lines of: > > im

[Tutor] commands module

2007-12-06 Thread DS
I've been trying to do something that I thought was going to be relatively straight-forward, but so far I haven't found a good solution. What I'm trying to do is discover a pid on a process and kill it. The way that I thought that I could do it is something along the lines of: import commands p

Re: [Tutor] commands with multiple things to do?

2005-03-29 Thread Alan Gauld
> Is it possible for me to make a command do multiple things instead of 1? Yes, its called writing a function or method. > self.submit_bttn = Button(self, text = "Tries: 0", command = self.reveal, self.update_count) > I have tried putting the code as 2 commands on separate lines, Try putting th

Re: [Tutor] commands with multiple things to do?

2005-03-29 Thread Danny Yoo
On Tue, 29 Mar 2005, Diana Hawksworth wrote: > Is it possible for me to make a command do multiple things instead of 1? > For instance, I have a button that allows me to "submit" some user input > (that is, show it in a window), but I also want it to count the number > of times that submit button

Re: [Tutor] commands with multiple things to do?

2005-03-28 Thread jfouhy
Quoting Diana Hawksworth <[EMAIL PROTECTED]>: > Is it possible for me to make a command do multiple things instead of > 1? Not directly ... But you can always write a function that does both things. > self.submit_bttn = Button(self, text = "Tries: 0", command = > self.reveal, self.update_count)

[Tutor] commands with multiple things to do?

2005-03-28 Thread Diana Hawksworth
Dear list!   Is it possible for me to make a command do multiple things instead of 1? For instance, I have a button that allows me to "submit" some user input (that is, show it in a window), but I also want it to count the number of times that submit button has been pressed.   I have tried th