Re: [Tutor] Communicating Between Programs Using Raw Inputs (con'd)

2011-06-20 Thread Christopher King
Also, we tried removing the raw input, but it wouldn't print correct On Sat, Jun 18, 2011 at 9:55 PM, aditya wrote: > > > On Sat, Jun 18, 2011 at 9:35 PM, Jacob Bender wrote: > >> Dear Tutors, >> >> Alright, I'm using linux (ubuntu) and I took all of your advice and I got >> something that works

Re: [Tutor] Communicating Between Programs Using Raw Inputs (con'd)

2011-06-20 Thread Christopher King
Well, that's a trick me and jake learned in a book to stop the program from changing. On Saturday, June 18, 2011, aditya wrote: > > > On Sat, Jun 18, 2011 at 9:35 PM, Jacob Bender wrote: > > Dear Tutors, > > Alright, I'm using linux (ubuntu) and I took all of your advice and I got > something t

Re: [Tutor] Communicating Between Programs Using Raw Inputs (con'd)

2011-06-18 Thread aditya
On Sat, Jun 18, 2011 at 9:35 PM, Jacob Bender wrote: > Dear Tutors, > > Alright, I'm using linux (ubuntu) and I took all of your advice and I got > something that works and doesn't work at the same time. Here's the source > code for my two programs called Lock and Key: > > *Lock.py: * > > password

Re: [Tutor] Communicating Between Programs Using Raw Inputs (con'd)

2011-06-18 Thread Alan Gauld
"Jacob Bender" wrote *Lock.py: * password = "a" psswd_try = raw_input("What's the password? ") if psswd_try == password: print "correct!!!" raw_input() else: print "wrong" raw_input() * Key.py*: import sys sys.stdout.write("a") And all went well except for an EOF error caused

[Tutor] Communicating Between Programs Using Raw Inputs (con'd)

2011-06-18 Thread Jacob Bender
Dear Tutors, Alright, I'm using linux (ubuntu) and I took all of your advice and I got something that works and doesn't work at the same time. Here's the source code for my two programs called Lock and Key: *Lock.py: * password = "a" psswd_try = raw_input("What's the password? ") if psswd_try

Re: [Tutor] Communicating Between Programs Using Raw Inputs

2011-06-14 Thread Steve Willoughby
As always, Alan has given a lot of great advice and useful information. There's just one piece at the end I would question, however: On 14-Jun-11 16:36, Alan Gauld wrote: > python reader.py < `python writer.py` Almost, but not quite. The backticks mean the command is executed and the output

Re: [Tutor] Communicating Between Programs Using Raw Inputs

2011-06-14 Thread Alan Gauld
"Jacob Bender" wrote I know how to do it in the command line, but not through another program. Generating the random tries for the password isn't the issue, but entering the password(s) in between the two programs is an issue because I don't know how to make programs communicate through raw

Re: [Tutor] Communicating Between Programs Using Raw Inputs

2011-06-14 Thread Steve Willoughby
On 14-Jun-11 15:48, Steven D'Aprano wrote: Normally you would do this by redirecting standard input. What operating system are you using? In Linux, you would do something like: # run script foo.py taking input from the output of bar.py foo.py < bar.py Actually, no, that will send the *source

Re: [Tutor] Communicating Between Programs Using Raw Inputs

2011-06-14 Thread Steven D'Aprano
Jacob Bender wrote: Dear Python Tutors, I was wondering how to break into my one program I made using brute force methods. Here's the code: password = "Helloworld" try= raw_input("What's the password?") while try != password: try = raw_input("Incorrect, what's the password?") I know how t

[Tutor] Communicating Between Programs Using Raw Inputs

2011-06-14 Thread Jacob Bender
Dear Python Tutors, I was wondering how to break into my one program I made using brute force methods. Here's the code: password = "Helloworld" try= raw_input("What's the password?") while try != password: try = raw_input("Incorrect, what's the password?") I know how to do it in the command