import getopt
import sys
def msg(parameter):
try:
options, args = getopt.getopt(parameter, "dn:")
except getopt.GetoptError:
sys.exit()
for option, value in options:
if option in ("-d"):
pass
if option in ("-n"):
return value
if args:
print("命令參數錯誤!")
sys.exit(0)
if __name__ == '__main__':
r = msg(sys.argv[1:])
if r is not None:
print(r)