On 21/10/18 07:13, boB Stepp wrote:

> My initial thought was to just have a sequence of game names with
> incrementing numerical suffixes:  game_0, game_1, ... , game_n.  But
> this would require the program to keep track of what the next
> available numerical suffix is.

The traditional approach to such scenarios (eg. for log files)
is to append the datetime. If that is not enough granularity
you can additionally append a numeric suffix that applies
only during a single session(ie a global variable) and is
only applied when the datetimes are identical - very rare.

> tempfile.NamedTemporaryFile(delete=False) would solve this problem

Can't help there, I've never used it. :-)

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to