Reputation: 169
I'd like to specify a filename based on a different id number. How can I set different a file name according to a different id value?
id = args.bdp_id
filename = "./temp/vtx_vel%d.dat", id
print (filename)
Upvotes: 3
Views: 839
Reputation: 4371
See string.format if you want to use sprintf style substitutions:
filename = string.format("./temp/vtx_vel%d.dat", id)
Upvotes: 3