注册 登录
编程论坛 Python论坛

小白一名,刚开始学习python,关于argv无反应,求大神帮帮忙!

LanXX 发布于 2019-08-05 23:13, 2116 次点击
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)

在PowerShell运行,并输入三个参数后,没有任何反应,如果多数参数或者少输参数都会有反应,求大神帮我看看是怎么一回事,谢谢您们~。
只有本站会员才能查看附件,请 登录
3 回复
#2
TysonKoothra2019-08-06 08:53
print = ("The script is called:", script)这样写不是打印,应该写成print("The script is called:", script)
#3
LanXX2019-08-06 14:05
回复 2楼 TysonKoothra
谢谢,大神,我脑抽了,竟然看了很久没看出来,谢谢点醒我。
#4
TysonKoothra2019-08-06 15:39
回复 3楼 LanXX
不客气,不是大神,共同学习。
1