En Tue, 24 Feb 2009 07:18:41 -0200, venutaurus...@gmail.com
escribió:
Thank you for your solution. It really helped. But how should I give
if my path is in a varialble.
For ex: path has that value obtained through command line arguments.
path = sys.argv[2]
In such a case how can we convert
On Feb 24, 1:44 pm, "Gabriel Genellina"
wrote:
> En Tue, 24 Feb 2009 05:15:33 -0200, venu madhav
> escribió:
>
>
>
> >> > def findFile(dir_path):
> >> > for name in os.listdir(dir_path):
> >> > full_path = os.path.join(dir_path, name)
> >> > print full_path
> >> > if
En Tue, 24 Feb 2009 05:15:33 -0200, venu madhav
escribió:
> def findFile(dir_path):
> for name in os.listdir(dir_path):
> full_path = os.path.join(dir_path, name)
> print full_path
> if os.path.isdir(full_path):
> findFile(full_path)
> else:
>
Try os.walk for recursively walking directories. Also if you use a unicode
parameter with os.walk or os.listdir you get unicode strings in the result. To
run this successfully when you have non-ascii characters in your filenames, you
will need to use an environment that supports the characters
On Tue, Feb 24, 2009 at 12:16 PM, Chris Rebert wrote:
> A. Your reason for emailing us off-list makes no sense. The list would
> garner you more and about as quick responses, not to mention the value
> it adds through public archiving. CC-ing us /might/ have made slight
> sense.
> B. This is your
A. Your reason for emailing us off-list makes no sense. The list would
garner you more and about as quick responses, not to mention the value
it adds through public archiving. CC-ing us /might/ have made slight
sense.
B. This is your problem:
v = unicode(full_path,errors='skip')
I'd advise you