On Sun, May 15, 2016, at 17:52, Chris Angelico wrote:
> On Mon, May 16, 2016 at 2:00 AM, Grant Edwards
> wrote:
> > On 2016-05-15, Michael Selik wrote:
> >> On Sun, May 15, 2016, 10:37 AM Grant Edwards
> >> wrote:
>
On Mon, May 16, 2016 at 2:00 AM, Grant Edwards
wrote:
> On 2016-05-15, Michael Selik wrote:
>> On Sun, May 15, 2016, 10:37 AM Grant Edwards
>> wrote:
>>> On 2016-05-15, Tim Chase
Tim Chase wrote:
> On 2016-05-15 14:36, Grant Edwards wrote:
> > On 2016-05-15, Tim Chase wrote:
> > > unless sorted() returns a lazy sorter,
> >
> > What's a lazy sorter?
>
> A hypothetical algorithm that can spool out a sorted
On 2016-05-15 14:36, Grant Edwards wrote:
> On 2016-05-15, Tim Chase wrote:
> > unless sorted() returns a lazy sorter,
>
> What's a lazy sorter?
A hypothetical algorithm that can spool out a sorted sequence without
holding the entire sequence in memory at the same
On 2016-05-15, Michael Selik wrote:
> On Sun, May 15, 2016, 10:37 AM Grant Edwards
> wrote:
>> On 2016-05-15, Tim Chase wrote:
>>>
>>> unless sorted() returns a lazy sorter,
>>
>> What's a lazy sorter?
>
> One
On Sun, May 15, 2016, 10:37 AM Grant Edwards
wrote:
> On 2016-05-15, Tim Chase wrote:
> > On 2016-05-15 11:46, Peter Otten wrote:
> >> def sorted_dir(folder):
> >> def getmtime(name):
> >> path = os.path.join(folder, name)
>
On Sun, May 15, 2016 at 10:36 AM, Grant Edwards
wrote:
> On 2016-05-15, Tim Chase wrote:
>> On 2016-05-15 11:46, Peter Otten wrote:
>>> def sorted_dir(folder):
>>> def getmtime(name):
>>> path = os.path.join(folder, name)
>>>
On 2016-05-15, Tim Chase wrote:
> On 2016-05-15 11:46, Peter Otten wrote:
>> def sorted_dir(folder):
>> def getmtime(name):
>> path = os.path.join(folder, name)
>> return os.path.getmtime(path)
>>
>> return sorted(os.listdir(folder),
Le 15/05/2016 10:47, c...@isbd.net a écrit :
I have a little Python program I wrote myself which copies images from
a camera (well, any mounted directory) to my picture archive. The
picture archive is simply a directory hierarchy of dates with years at
the top, then months, then days.
My
Tim Chase wrote:
> On 2016-05-15 11:46, Peter Otten wrote:
>> def sorted_dir(folder):
>> def getmtime(name):
>> path = os.path.join(folder, name)
>> return os.path.getmtime(path)
>>
>> return sorted(os.listdir(folder), key=getmtime, reverse=True)
>>
>> The same idea will
On Sun, May 15, 2016 at 9:15 PM, Tim Chase
wrote:
> On 2016-05-15 11:46, Peter Otten wrote:
>> def sorted_dir(folder):
>> def getmtime(name):
>> path = os.path.join(folder, name)
>> return os.path.getmtime(path)
>>
>> return
On 2016-05-15 11:46, Peter Otten wrote:
> def sorted_dir(folder):
> def getmtime(name):
> path = os.path.join(folder, name)
> return os.path.getmtime(path)
>
> return sorted(os.listdir(folder), key=getmtime, reverse=True)
>
> The same idea will work with pathlib and
On 2016-05-15 20:48, Steven D'Aprano wrote:
> Also, remember that most operating systems provide (at least) three
> different times. I'm not sure which one you want, but if I had to
> guess, I would probably guess mtime. If I remember correctly:
>
> atime is usually the last access time;
> mtime
On Sunday 15 May 2016 18:47, c...@isbd.net wrote:
> What I want is a list in the order produced by:-
> ls --sort=time
I'm not sure if this is the best way to do it, but what I would do is sort the
directory list by the file's time metadata, which you can access using os.stat.
To sort the
c...@isbd.net wrote:
> I have a little Python program I wrote myself which copies images from
> a camera (well, any mounted directory) to my picture archive. The
> picture archive is simply a directory hierarchy of dates with years at
> the top, then months, then days.
>
> My Python program
I have a little Python program I wrote myself which copies images from
a camera (well, any mounted directory) to my picture archive. The
picture archive is simply a directory hierarchy of dates with years at
the top, then months, then days.
My Python program simply extracts the date from the
16 matches
Mail list logo