Re: How do I get number of files in a particular directory.

2010-08-13 Thread Alister Ware
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

Re: How do I get number of files in a particular directory.

2010-08-13 Thread blur959
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

Re: How do I get number of files in a particular directory.

2010-08-13 Thread Dave Angel
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

Re: How do I get number of files in a particular directory.

2010-08-13 Thread Peter Otten
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

Re: How do I get number of files in a particular directory.

2010-08-13 Thread blur959
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 > >

Re: How do I get number of files in a particular directory.

2010-08-13 Thread Stefan Schwarzer
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

Re: How do I get number of files in a particular directory.

2010-08-13 Thread blur959
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.

Re: How do I get number of files in a particular directory.

2010-08-13 Thread Cameron Simpson
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

Re: How do I get number of files in a particular directory.

2010-08-13 Thread Bruno Desthuilliers
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

How do I get number of files in a particular directory.

2010-08-13 Thread blur959
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