[Tutor] Fwd: glob and file names

Gabriele Brambilla gb.gabrielebrambilla at gmail.com
Fri Jun 6 04:15:20 CEST 2014


---------- Forwarded message ----------
From: Gabriele Brambilla <gb.gabrielebrambilla at gmail.com>
Date: 2014-06-05 22:15 GMT-04:00
Subject: Re: [Tutor] glob and file names
To: Peter Romfeld <peter.romfeld.hk at gmail.com>


thanks,

it works.

Gabriele


2014-06-05 22:10 GMT-04:00 Peter Romfeld <peter.romfeld.hk at gmail.com>:

On Friday, June 06, 2014 10:04 AM, Gabriele Brambilla wrote:
> >
> > fiLUMOname = 'Lsum_' + period + '_' + parts[2] + '_' + parts[3] + '_'
> > + parts[4] + '_*.dat'
> >
> > aaa = glob.glob(fiLUMOname)
> > print(aaa)
> > fiLUMO = open(aaa[0], 'r')
>
> i would do:
>
> aaa = glob.glob('Lsum_%s_%s_%s_%s_*.dat' % (period, parts[2], parts[3],
> parts[4]))
>
> cheers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140605/9734799e/attachment.html>


More information about the Tutor mailing list