Raw Input Question

Erik Max Francis max at alcyone.com
Tue Aug 26 22:49:27 EDT 2003


hokiegal99 wrote:

> How can I pass the content of one varible into raw_input? See below
> for
> 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
> could
> 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:"

or

	"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 mailing list