On Fri, 13 Aug 2010 07:40:42 -0700, blur959 wrote:
> Hi all, I got a problem with my script. Everything looks good so far but
> for some reason my os.rename isn't working. Can anyone tell me why? Hope
> you guys could help. Thanks.
>
You have a number of logic flaws in your code.
1st you do not
Hi all, I got a problem with my script. Everything looks good so far
but for some reason my os.rename isn't working. Can anyone tell me
why? Hope you guys could help. Thanks.
import os
import glob
directory = raw_input("directory? ")
ext = raw_input("file extension? ")
r = raw_input("replace na
blur959 wrote:
On Aug 13, 6:09 pm, Peter Otten <__pete...@web.de> wrote:
blur959 wrote:
Hi, I tried that, but it doesn't seem to work. My file directory has
many different files extensions, and I want it to return me a number
based on the number of files with similar files extensions. B
blur959 wrote:
> On Aug 13, 6:09 pm, Peter Otten <__pete...@web.de> wrote:
>> blur959 wrote:
>> > Hi, I tried that, but it doesn't seem to work. My file directory has
>> > many different files extensions, and I want it to return me a number
>> > based on the number of files with similar files exte
On Aug 13, 6:09 pm, Peter Otten <__pete...@web.de> wrote:
> blur959 wrote:
> > Hi, I tried that, but it doesn't seem to work. My file directory has
> > many different files extensions, and I want it to return me a number
> > based on the number of files with similar files extensions. But when I
> >
On 2010-08-13 11:18, blur959 wrote:
> import os
>
> directory = raw_input("Please input file directory. \n\n")
> s = raw_input("Please input a name to replace. \n\n")
> ext = raw_input("input file ext")
>
> for files in os.listdir(directory):
> if ext in files:
> file_number = len(fil
Hi, I tried that, but it doesn't seem to work. My file directory has
many different files extensions, and I want it to return me a number
based on the number of files with similar files extensions. But when I
tried running it, I get many weird numbers. Below is my code i had so
far and the result.
On 13Aug2010 00:54, blur959 wrote:
| Hi, all, Is there a way to get a number of files in a particular
| directory? I tried using os.walk, os.listdir but they are return me
| with a list, tuple of the files, etc. But I want it to return a
| number. Is it possible?
Measure the length of the list re
blur959 a écrit :
Hi, all, Is there a way to get a number of files in a particular
directory? I tried using os.walk, os.listdir but they are return me
with a list, tuple of the files, etc. But I want it to return a
number. Is it possible?
len(any_sequence)
--
http://mail.python.org/mailman/list
Hi, all, Is there a way to get a number of files in a particular
directory? I tried using os.walk, os.listdir but they are return me
with a list, tuple of the files, etc. But I want it to return a
number. Is it possible?
--
http://mail.python.org/mailman/listinfo/python-list
10 matches
Mail list logo