Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #102745
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Anthony Papillion <anthony@cajuntechie.org> |
| Newsgroups | comp.lang.python |
| Subject | Re: [SOLVED] There has to be a better way to split this string! |
| Date | Tue, 9 Feb 2016 19:40:21 -0600 |
| Lines | 18 |
| Message-ID | <mailman.9.1455068428.7749.python-list@python.org> (permalink) |
| References | <56BA91B5.5090400@cajuntechie.org> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.uni-berlin.de XVv+/7lH1E3ZwCBMYcGlDQ9TWM78S+Njl1f6XnHkPIcw== |
| Return-Path | <anthony@cajuntechie.org> |
| 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; 'ugly': 0.07; 'filename.': 0.09; 'subject:string': 0.09; 'everyone,': 0.15; 'from:addr:anthony': 0.16; 'help?': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:There': 0.16; 'wrote:': 0.16; 'subject:] ': 0.19; 'replacing': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'skip:m 30': 0.27; "i'm": 0.30; 'code': 0.30; 'anyone': 0.32; "can't": 0.32; 'returned': 0.32; 'file': 0.34; 'received:10.0': 0.34; 'something': 0.35; 'but': 0.36; 'there': 0.36; 'to:addr:python- list': 0.36; 'pm,': 0.36; 'received:10': 0.37; 'seem': 0.37; 'doing': 0.38; 'version': 0.38; 'to:addr:python.org': 0.40; 'received:10.0.2': 0.84; 'ugly,': 0.84; 'subject:this': 0.85 |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 |
| In-Reply-To | <56BA91B5.5090400@cajuntechie.org> |
| X-Zoho-Virus-Status | 1 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.21rc2 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Xref | csiph.com comp.lang.python:102745 |
Show key headers only | View raw
On 02/09/2016 07:26 PM, Anthony Papillion wrote: > Hello Everyone, > > 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 > > Notice I'm replacing all of the "."'s, " "'s, and ":"'s returned by > datetime.now() with "-"'s. I'm doing that using the following code but > it's freaking ugly and I KNOW there is a better way to do it. I just > can't seem to think of it right now. Can anyone help? What is the > "right", or at least, less ugly, way to do this task? Found the solution in strftime(). Exactly what I was looking for.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: [SOLVED] There has to be a better way to split this string! Anthony Papillion <anthony@cajuntechie.org> - 2016-02-09 19:40 -0600
csiph-web