Follow the stupid method of Python, and learn python for a few days, and you want to show off.
According to the textbook hit the code, barely enough to calculate a program it. The script is the. py file we wrote!
Formally cut into the theme
>>>#-*-coding:utf-8-*- #声明这是utf编码! Prevent garbled!
>>>os_char = ' GB18030 '
>>>from sys import argv #从sys模块导入argv (parametric variable)
>>>script, user_name = argv #把argv的参数分给script和user_name, this process is called unpack (unpacking)
>>>prompt = ">" #在提示 > enter the data you want!
>>>print "Hi%s, I ' m ' the%s script."% (user_name, script)
>>>print "%s, do you like me?" ". Encode (Os_char)% user_name #%s,%r,%d is the format Control tool that tells Python to put the value on the right side into the position of the left%s!
>>>A1 = Raw_input (Prompt) #raw_input () raw input
>>>print, who is your goddess? ", Encode (Os_char)
>>>A2 = Raw_input (Prompt)
>>>print "What's your favorite person?" ". Encode (Os_char)
>>>A3 = Raw_input (Prompt)
>>>print "" "
Now, according my gatherations, you said '%s ' to Me,and
Your Said:your Goddess "%s", your favorate People is "%s".
"" "% (A1, A2, A3)
You can enter the above code in the editor sublime Text2, or in Notepad (win+r input notepad).
Then save the suffix as a. py. The parameter variable (Argument variable) mentioned above is a standard programming term that guarantees
Save the parameters you passed to it when you ran the Python script (Argument)!
A small interactive script