forked from imkingcn/python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex13.py
More file actions
24 lines (20 loc) · 609 Bytes
/
ex13.py
File metadata and controls
24 lines (20 loc) · 609 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#coding:utf-8
#################
# 习题13:参数,解包和变量
#################
# 前言
#
# 另外一种将变量传递给脚本的方法,
#
# 写一个可以接受参数的脚本
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
# 笔记
# 1.这里初步体验了python引入模块的方法
# 2.先感受一下,后面才是正菜
# 3.运行这个脚本的时候:
#python ex13.py first 2nd 3rd(后面三个是传递的参数)