[Tutor] Communicating Between Programs Using A Raw Input (Cont'd)

Alan Gauld alan.gauld at btinternet.com
Fri Jun 17 23:07:50 CEST 2011


"Jacob Bender" <benderjacob44 at gmail.com> wrote


> did have one question however, and that is will I need to modify the 
> code of
> my password program?

No, if it uses raw_input and print it will be using atdin and stdout
so you can pipe from one program into the other

Here's the code again:
>
> password = "Helloworld"
> try= raw_input("What's the password?")
> while try != password:
> try = raw_input("Incorrect, what's the password?")
>

Just try it and see. If it doesn't work get back to us - with the
output of course :-)


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list