本文共 646 字,大约阅读时间需要 2 分钟。
import sysarg = sys.argv[1:]if len(arg) < 1: print("argumen is less!") sys.exit(0)name = arg[0]#从命令行读取参数print("Hello",name)sys.exit(0)
然后把它打包成可执行程序helloworld。
pip install pyinstaller
),安装后仍然提示,重启终端。#includeusing namespace std;int main(){ system("./helloworld XiaoMing"); return 0;}
dist/
下会多出一个helloworld
,把它拿出来放到test.cpp同一目录下。转载地址:http://dzbtb.baihongyu.com/