Raw Input Question
Erik Max Francis
max at alcyone.com
Wed Aug 27 04:49:27 CEST 2003
> How can I pass the content of one varible into raw_input? See below
> what I'm trying to do:
> XXX = raw_input("1. Enter the string that you'd like to find: ")
> y = raw_input("2. Enter the string that you'd like to replace XXX
> with: ")
> I'm trying to pass x into y. I tried the "Enter the string that you'd
> like to replace", XXX, "with:" approach, but Pyhton told me that I
> only pass 1 argument, no more.
raw_input takes a string, and a string like any other. You can build
the string yourself:
"Enter the string to replace " + XXX + " with:"
"Enter the string to replace %s with:" % XXX
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
__ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/ \ There never was a good war or a bad peace.
\__/ Benjamin Franklin
More information about the Python-list