我正在使用下面的代码获取更改in,然后进行循环...我需要在文件change_ids.txt..I中反转in需要一些最佳方法的想法?请提供您的想法。
with open(timedir + "/change_ids.txt", "wb") as f:
check_call("ssh -p 29418 company.com "
"gerrit query --commit-message --files --current-patch-set "
"status:open project:platform/vendor/com-proprietary/code branch:master |"
"grep refs |"
"cut -f4 -d'/'",
shell=True, # need shell due to the pipes
stdout=file) # redirect to a file
for line in open(timedir + "/change_ids.txt"):
#codechange_ids.txt包含
210717
210716
210715
210714
210713发布于 2013-01-08 16:45:41
这将从下到上处理这些行:
for line in reversed(list(open(timedir + "/gerrit_ids.txt"))):
...https://stackoverflow.com/questions/14211166
复制相似问题