我知道我们可以这样调用:
os.system("ant compile")
但是如何知道ant任务是否成功呢?
还有其他方法来调用 ant 任务吗?
最佳答案
os.system
返回返回代码。所以你可以捕获它并检查它。
rc = os.system("ant compile")
if rc != 0:
print "Error on ant compile"
sys.exit(1)
关于python - 如何在python脚本中调用ant任务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3974801/