Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Re: [SOLVED] There has to be a better way to split this string! Date: Wed, 10 Feb 2016 12:47:16 +1100 Lines: 17 Message-ID: References: <56BA91B5.5090400@cajuntechie.org> <56BA9505.40900@cajuntechie.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de r9cYQ//NFA0JtDPSc3rW6Q9UZpvT7swl3lnG8bwomVYA== Cancel-Lock: sha1:1l2zsm4uvvJCPAt0Ikwb9hgqzSI= Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:: [': 0.03; 'filename,': 0.09; 'filename.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:string': 0.09; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subject:There': 0.16; 'wrote:': 0.16; 'subject:] ': 0.19; 'module': 0.25; 'header:User-Agent:1': 0.26; 'header:X-Complaints- To:1': 0.26; 'task': 0.30; 'library.': 0.35; 'should': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'received:org': 0.37; 'version': 0.38; 'to:addr:python.org': 0.40; 'making': 0.62; 'god': 0.67; 'skip:\xe2 10': 0.70; '8bit%:43': 0.72; '_o__)': 0.84; 'received:125': 0.84; 'subject:this': 0.85; 'fellows,': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: jigong.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:102747 Anthony Papillion 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 distrust those people who know so well what God wants them | `\ to do to their fellows, because it always coincides with their | _o__) own desires.” —Susan Brownell Anthony, 1896 | Ben Finney