# -*- coding:utf-8 -*-
import sys
param = None
if len(sys.argv) > 1:
param = int(sys.argv[1])
if param is None:
print "Alert"
print "The param is not set"
elif param < -10:
print "The param is small"
elif param > 10:
print "The param is big"
else:
print "The param is middle"
# sys.argv是一个系统List变量
# Python解释器在运行Python程序是将命令行参数传入sys.argv中。
# sys.argv中的第一个值(索引为0)是Python程序名,从第2个(索引为1)开始
# 的其他元素为字符串类型的控制台输入参数
# 没有输入参数
# C:\Users\29485\Desktop
# $ python test.py
# Alert
# The param is not set
# 输入较小的参数
# C:\Users\29485\Desktop
# $ python test.py -18
# The param is small
# 输入中等值的参数
# C:\Users\29485\Desktop
# $ python test.py 2
# The param is middle