First of all, i'm very extremely noob, beginner etc. in python and programming in general, so sorry for the further questions but i have this sample code:
from sys import argv
p_script = argv
p_user_name = argv
p_id = argv
v_prompt = ": "
print "Hey %s, I'm the %s script with id: '%s'" % (p_user_name, p_script, p_id)
print "I'd like to ask you a few questions."
print "Do you like me %s?" % p_user_name
v_likes = raw_input(v_prompt)
print "Where do you live %s?" % p_user_name
v_lives = raw_input(v_prompt)
print "What kind of computer do you have?"
v_computer = raw_input(v_prompt)
print """Alright, so you said '%s' about liking me.
You live in '%s'. Not sure where that is.
And you have a '%s' computer. Nice.""" % (v_likes, v_lives, v_computer)
and this:
from sys import argv
p_script, p_user_name, p_id = argv
v_prompt = ": "
print "Hey %s, I'm the %s script with id: '%s'" % (p_user_name, p_script, p_id)
print "I'd like to ask you a few questions."
print "Do you like me %s?" % p_user_name
v_likes = raw_input(v_prompt)
print "Where do you live %s?" % p_user_name
v_lives = raw_input(v_prompt)
print "What kind of computer do you have?"
v_computer = raw_input(v_prompt)
print """Alright, so you said '%s' about liking me.
You live in '%s'. Not sure where that is.
And you have a '%s' computer. Nice.""" % (v_likes, v_lives, v_computer)
i really don't understand why the output is crazy, like after passing the arguments or parameters as strings into the code when running it in powershell (i.e: exec python "example 1", "Name", "101") it gives me after each stept on run-time all the arguments. So what i'm trying to ask here, is why it doesn't works as-well correctly on different style o parameter declaration. See pls the declaration field of the first code snippet and the second declaration field i.e the "classic" style. Many Thanks, cheers.
argv[1]). Try read through this effbot.org/zone/python-list.htm