Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #102749 > unrolled thread
| Started by | Anthony Papillion <anthony@cajuntechie.org> |
|---|---|
| First post | 2016-02-09 19:58 -0600 |
| Last post | 2016-02-09 19:58 -0600 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [SOLVED] There has to be a better way to split this string! Anthony Papillion <anthony@cajuntechie.org> - 2016-02-09 19:58 -0600
| From | Anthony Papillion <anthony@cajuntechie.org> |
|---|---|
| Date | 2016-02-09 19:58 -0600 |
| Subject | Re: [SOLVED] There has to be a better way to split this string! |
| Message-ID | <mailman.13.1455069512.7749.python-list@python.org> |
On 02/09/2016 07:47 PM, Ben Finney wrote: > Anthony Papillion <anthony@cajuntechie.org> writes: > >> On 02/09/2016 07:26 PM, Anthony Papillion wrote: >>> I am using datetime.now() to create a unique version of a filename. >>> […] >> >> Found the solution in strftime(). Exactly what I was looking for. > > For the task of making a unique filename, you should also consider the > ‘tempfile’ module in the standard library. I looked at tempfile. Unfortunately, the filename has to be both 'unique' and 'identifiable' to the original. So if I am using mydog.jpg as the source and I am adding something unique to it, it has to still have mydog.jpg in the filename. Tempfile, I think, doesn't allow an easy way to do that. So I'm just adding the exact date and time which is unique enough for my purposes. Thanks for the pointer though. Anthony
Back to top | Article view | comp.lang.python
csiph-web