Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Cameron Simpson Newsgroups: comp.lang.python Subject: Re: There has to be a better way to split this string! Date: Wed, 10 Feb 2016 17:50:02 +1100 Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Trace: news.uni-berlin.de NvGBuL+cB/e6Jc9s48hkFQOdW4scjRVq+wmZe3HuiAJQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'assumed': 0.09; 'filename.': 0.09; 'strftime': 0.09; 'subject:string': 0.09; '...]': 0.16; '2016': 0.16; '6:56': 0.16; '>on': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'inverse': 0.16; 'message- id:@cskk.homeip.net': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'simpson': 0.16; 'subject:There': 0.16; 'wrote:': 0.16; 'looked': 0.16; 'cc:addr:python.org': 0.20; 'cc:2**1': 0.22; 'cheers,': 0.22; 'trying': 0.22; 'am,': 0.23; 'feb': 0.23; 'wrote': 0.23; 'header:In-Reply-To:1': 0.24; 'header :User-Agent:1': 0.26; 'skip:m 30': 0.27; 'module.': 0.27; 'idea': 0.28; 'awake': 0.29; 'problem': 0.33; 'extract': 0.33; 'file': 0.34; 'list': 0.34; 'something': 0.35; 'subject:: ': 0.37; 'suggestion': 0.37; 'charset:us-ascii': 0.37; 'version': 0.38; 'received:localdomain': 0.38; 'mailing': 0.38; 'unable': 0.39; 'easily': 0.39; 'soon': 0.65; 'cameron': 0.66; 'realise': 0.66; 'reply': 0.68; 'mail.': 0.75; 'saw': 0.77; 'subject:this': 0.85 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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:102756 On 10Feb2016 07:34, srinivas devaki wrote: >On Feb 10, 2016 7:23 AM, "srinivas devaki" >wrote: >> On Feb 10, 2016 6:56 AM, "Anthony Papillion" >wrote: >> > I am using datetime.now() to create a unique version of a filename. >> > When the final file is named, it will look something like: >> > myfile-2015-02-09-19-08-45-4223 >> >> You can easily do this(retrieving the tokens) using re module. [... complicated suggestion for the inverse problem ...] > >I'm a stupid. >as soon as I saw strftime it looked like strptime and I assumed he is >trying to extract the tokens and wrote that stupid/unrelated mail. > >PS: trying to read mailing list when you are half woke, is a bad idea and >trying reply to it is even bad idea. Regrettably, when one is half awake one is unable to realise what a bad idea it may be:-) Cheers, Cameron Simpson