Τη Τετάρτη, 6 Μαρτίου 2013 4:04:26 μ.μ. UTC+2, ο χρήστης Michael Ross έγραψε:
> On Wed, 06 Mar 2013 12:52:00 +0100, Mark Lawrence
>
> wrote:
>
>
>
> > On 06/03/2013 07:45, Νίκος Γκρ33κ wrote:
>
> >> I'am using this snipper to read a current directory and insert all
>
> >> filenames into
Dave Angel writes:
>># Compute a set of current fullpaths
>>current_fullpaths = set()
>>for root, dirs, files in os.walk(path):
>> for fullpath in files:
>
> 'fullpath' is a rather misleading name to use, since the 'files' list
> contains only the terminal node of the file name.
On Wed, 06 Mar 2013 12:52:00 +0100, Mark Lawrence
wrote:
On 06/03/2013 07:45, Νίκος Γκρ33κ wrote:
I'am using this snipper to read a current directory and insert all
filenames into a databse and then display them.
But what happens when files are get removed form the directory?
The inserted
On Wed, Mar 6, 2013 at 10:52 PM, Mark Lawrence wrote:
> On 06/03/2013 07:45, Νίκος Γκρ33κ wrote:
>> blah blah blah
>> blah blah blah
>> blah blah blah
> You were told yesterday at least twice that os.walk returns a tuple but you
> still insist on refusing to take any notice of our replies when it
On 03/06/2013 05:27 AM, Lele Gaifax wrote:
Νίκος Γκρ33κ writes:
Its about the following line of code:
current_fullpaths.add( os.path.join(root, files) )
I'm sorry, typo on my part.
That should have been "fullpath", not "file" (and neither "files" as you
wrongly reported back!):
# Compu
On 06/03/2013 07:45, Νίκος Γκρ33κ wrote:
I'am using this snipper to read a current directory and insert all filenames
into a databse and then display them.
But what happens when files are get removed form the directory?
The inserted records into databse remain.
How can i update the databse to
Νίκος Γκρ33κ writes:
> Its about the following line of code:
>
> current_fullpaths.add( os.path.join(root, files) )
I'm sorry, typo on my part.
That should have been "fullpath", not "file" (and neither "files" as you
wrongly reported back!):
# Compute a set of current fullpaths
current_fu
On Wednesday, March 6, 2013 9:43:34 AM UTC, Νίκος Γκρ33κ wrote:
> Perhaps because my filenames is in greek letters that thsi error is presented
> but i'am not sure.
>
>
>
> Maybe we can join root+files and store it to the set() someway differenyl
well, the error refers to the line "if
Perhaps because my filenames is in greek letters that thsi error is presented
but i'am not sure.
Maybe we can join root+files and store it to the set() someway differenyl
--
http://mail.python.org/mailman/listinfo/python-list
Its about the following line of code:
current_fullpaths.add( os.path.join(root, files) )
that presents the following error:
: 'list' object has no attribute 'startswith'
args = ("'list' object has no attribute 'startswith'",)
message = "'list' object has no attribute 'startswith'"
Νίκος Γκρ33κ writes:
> Thank you very much for making things clear to me!!
You're welcome, even more if you spend 1 second to trim your answers
removing unneeded citation :-)
>
> But there is a slight problem when iam trying to run the code iam presenting
> this error ehre you can see its outp
Τη Τετάρτη, 6 Μαρτίου 2013 10:19:06 π.μ. UTC+2, ο χρήστης Lele Gaifax έγραψε:
> Νίκος Γκρ33κ writes:
>
>
>
> > How can i update the databse to only contain the existing filenames
> > without losing the previous stored data?
>
>
>
> Basically you need to keep a list (or better, a set) conta
Νίκος Γκρ33κ writes:
> How can i update the databse to only contain the existing filenames without
> losing the previous stored data?
Basically you need to keep a list (or better, a set) containing all
current filenames that you are going to insert, and finally do another
"inverse" loop where
I'am using this snipper to read a current directory and insert all filenames
into a databse and then display them.
But what happens when files are get removed form the directory?
The inserted records into databse remain.
How can i update the databse to only contain the existing filenames without
14 matches
Mail list logo