笨办法学python 13题:pycharm 运行

笨办法学python 13题

代码:

 1 # -*- coding: utf-8 -*-
 2 from sys import argv
 3 
 4 # argv--argument variable 参数变量
 5 script, first, second, third = argv
 6 
 7 print "the script is called:", script
 8 
 9 print "your first variable is:", first
10 
11 print "your second variable is:", second
12 
13 print "your third variable is:", third

pycharm直接运行时,会报:ValueError: need more than 1 value to unpack

意思是:还需要一个值才能解包

使用pycharm正常运行ex13:edit configurations--parameters输入参数--apply--运行

然后重新点运行,正常运行,并输出结果

 ps:14题同样的运行方式:

user_name作为参数填入parameters中,然后正常运行,可以在控制台进行输入输出显示。

 

 

 

转载于:https://www.cnblogs.com/koudaiyoutang/p/10979213.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值