Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on wi 32 Type "help", "copyright", "credits" or "license" for more information. >>> a = raw_input("Who's yo daddy?: ") Who's yo daddy?: Bubby June >>> print a Bubby June >>>
See how the variable "a" now has the whole sentence "Bubby June" in it? You can call split on "a" now and you'll get a list of words: >>> Names = a.split() >>> print Names ['Bubby','June'] >>> --Michael On 9/19/07, Boykie Mackay <[EMAIL PROTECTED]> wrote: > > Hi again, > > I have racked my brains and tried googling but to no avail. > > Is there any simple way of getting parameter input from the user? > > What I want to do is to type in two (or more) values on the command > prompt and have a function do some work on them and return a result.For > example say I had a multiplication function that I wanted to work as > follows: > > [EMAIL PROTECTED]:~/dir/project$python multiply.py > [EMAIL PROTECTED]:~/dir/project$10 12 [enter] > [EMAIL PROTECTED]:~/dir/project$120 > > Basically I want to start the program 'multiply.py',then be presented > with a blank screen in which I enter the numbers I want multipied > seperated by a space e.g 1 10 11 to give an answer of 110.I have used > the raw_input() and input() functions but it seems they only take on > value at a time! > > I suppose what I'm really asking is how to receive muliple values of > input from a user on a single line? > > > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > -- Michael Langford Phone: 404-386-0495 Consulting: http://www.TierOneDesign.com/ Entertaining: http://www.ThisIsYourCruiseDirectorSpeaking.com
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor