sys.stdout.flush()以及subprocess的用处

sys.stdout.flush()立即把stdout缓存内容输出。

subprocess与shell进行交互,执行shell命令等。

执行shell命令集合:

subprocess.check_output("git checkout master",shell=True)

subprocess.check_output(["git", "checkout", "master"])

参考:

https://www.cnblogs.com/valleyofwind/p/8628925.html

https://www.cnblogs.com/domestique/p/8056269.html

猜你喜欢

转载自www.cnblogs.com/shengulong/p/10398631.html