Unicode Decode Error

2010-10-08 Thread Pratik Khemka
UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position 152: ordinal not in range(128). Can someone please help me with this error The error occurs in line wbk.save(p4_merge.xls). I have used import xlwt..Can someone just tell what do I need to do to get rid of this error. I read

RE: Unicode Decode Error

2010-10-11 Thread Pratik Khemka
ted code byte From: ian.g.ke...@gmail.com Date: Fri, 8 Oct 2010 16:59:19 -0600 Subject: Re: Unicode Decode Error To: python-list@python.org On Fri, Oct 8, 2010 at 3:31 PM, Pratik Khemka wrote: UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position 152: ordinal no

File comparison with exceptions

2010-10-12 Thread Pratik Khemka
I am comparing 2 files (.txt files) using filecmp.cmp(File1, File2, shallow=False) I want to allow exceptions like these: File 1 File 2 6522,6523d6521 6591,6592d6590 6536d6533 6605d6602 So basically I want to ignore these differ

Reading after a symbol..

2010-10-12 Thread Pratik Khemka
Say : line = abcdabcd#12 adssda index = line.find('#') num = line[index:index+2] num will now be 12. Likewise I want to read the number after the '#' and store it in num. The problem is that the number can be a 1/2/3/4 digit number. So is there a way in which I can define num so t

Hyperlink to a file using python

2010-10-13 Thread Pratik Khemka
I want to create a hyperlink in my excel sheet using python such that when you click on that link (which is a file name (html file)), the file automatically opens. This file is present in the same folder in which the python code file is present. I am using xlwt module link= 'abcd.html'

RE: Hyperlink to a file using python

2010-10-13 Thread Pratik Khemka
0 > > On 10/13/2010 1:57 PM Pratik Khemka said... > > > > I want to create a hyperlink in my excel sheet using python such that when > > you click on that link (which is a file name (html file)), the file > > automatically opens. This file is present in the same fo

Searching in str backwards

2010-10-13 Thread Pratik Khemka
I want to search for a symbol in a string backwards.. For eg: line = "my/cat/dog/baby" line.find('/') # but from the back... The reason I want to do this is because I want to print the last part of the string after the '/' . And I do not know how long the string might be or how many '/' i

RE: Hyperlink to a file using python

2010-10-14 Thread Pratik Khemka
python > From: c...@rebertia.com > To: pratikkhe...@hotmail.com > CC: python-list@python.org > > >> To: python-list@python.org > >> From: em...@fenx.com > >> Subject: Re: Hyperlink to a file using python > >> Date: Wed, 13 Oct 2010 14:19:36 -0700 > >&