Re: Problem in accessing files with unicode fonts.

2009-02-24 Thread Gabriel Genellina
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

Re: Problem in accessing files with unicode fonts.

2009-02-24 Thread venutaurus...@gmail.com
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

Re: Problem in accessing files with unicode fonts.

2009-02-24 Thread Gabriel Genellina
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: >

Re: Problem in accessing files with unicode fonts.

2009-02-23 Thread Mark Tolonen
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

Re: Problem in accessing files with unicode fonts.

2009-02-23 Thread venu madhav
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

Re: Problem in accessing files with unicode fonts.

2009-02-23 Thread Chris Rebert
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