c++编译加执行脚本

python 脚本

1 #! /usr/bin/python
2 
3 import os
4 
5 msg = os.popen("g++ test.cpp").read();
6 print(msg);
7 
8 msg = os.popen("a.out").read();
9 print(msg);

使用makefile更合适

1 test: test2.cpp 
2     g++ -o test test2.cpp 
3 run: test 
4     ./test

猜你喜欢

转载自www.cnblogs.com/yuandonghua/p/11183496.html