#!/usr/bin/env python #encoding=utf-8import sysdef systest(): first = sys.argv[1] print firstdef judgeargv(): total = len(sys.argv) if total != 2: print "参数个数不等于1 退出程序" sys.exit(0)if __name__ == "__main__": judgeargv() systest()
本文共 302 字,大约阅读时间需要 1 分钟。
#!/usr/bin/env python #encoding=utf-8import sysdef systest(): first = sys.argv[1] print firstdef judgeargv(): total = len(sys.argv) if total != 2: print "参数个数不等于1 退出程序" sys.exit(0)if __name__ == "__main__": judgeargv() systest()
转载于:https://blog.51cto.com/wsxxsl/1956042