命令行:
$ python test.py "2019-05-05"
python脚本:
# test.py
import sys
print(sys.argv)
date_d = sys.argv[1]
print(date_d)
==> ["test.py", "2019-05-05"]
==> 2019-05-05
命令行:
$ python test.py "2019-05-05"
python脚本:
# test.py
import sys
print(sys.argv)
date_d = sys.argv[1]
print(date_d)
==> ["test.py", "2019-05-05"]
==> 2019-05-05