Doing simple Bash file write in Python
I'd like to replace this BASH expression:
expr $COUNT + 1 > $COUNT_FILE
with the equivalent in Python. I've come up with this:
subprocess.call("expr " + str(int(COUNT)+1) + " > " + COUNT_FILE, shell=True)
Is there a better way to do this?
No comments:
Post a Comment