raw_input,input,argv

笨方法学Python


from sys import argv

script, first, second, third = argv
#定义四个输入参数
print "The script is called:", script
print "Your first variable is:", first
print "Your second variable is:", second
print "Your third variable is:", third
##cmd运行 需要用户在命令行输入参数
>>>python ex13.py stuff things that
The script is called: ex13.py
Your first variable is: stuff
Your second variable is: things
Your third variable is: that
#在脚本执行中输入
raw_input = ("Your first variable is:")

>>> python ex12.py
>Your first variable is:apple
阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u010274840/article/details/51559329
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

raw_input,input,argv

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭