Python中sys模块sys.argv取值并判断
程序员文章站
2022-05-29 12:24:32
#!usr/bin/env python # -*- coding: utf-8 -*- # Author:Sun Xiaolin import sys judgement = sys.argv[1] #[]内写的值表示取第几个 # print(judgement) if judgement == ... ......
#!usr/bin/env python # -*- coding: utf-8 -*- # author:sun xiaolin import sys judgement = sys.argv[1] #[]内写的值表示取第几个 # print(judgement) if judgement == "1": print("一") elif judgement == "2": print("二") else:print("请正确输入")