Skip to content

Instantly share code, notes, and snippets.

@nachomartinr
Created January 13, 2017 11:49
Show Gist options
  • Save nachomartinr/ff96fac6b01169c09729a65ae9857ae9 to your computer and use it in GitHub Desktop.
Save nachomartinr/ff96fac6b01169c09729a65ae9857ae9 to your computer and use it in GitHub Desktop.
create incremental file name
import os
i = 0
while os.path.exists("model_%s.ckpt" % i):
i += 1
f = open("model_%s.ckpt" % i, "w")
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment