PyPDF Processing Errors (ValueError: invalid literal for int() with base 16: '\x00\x00')

2011-08-08 Thread blivori
readHexStringFromStream(stream) File "C:\Python27\lib\site-packages\pyPdf\gen… line 276, in readHexStringFromStream txt += chr(int(x, base=16)) ValueError: invalid literal for int() with base 16: '\x00\x00' -- http://mail.python.org/mailman/listinfo/python-list

Re: ValueError: invalid literal for int():

2010-07-26 Thread lee
On Jul 26, 4:30 pm, Steven D'Aprano wrote: > On Mon, 26 Jul 2010 04:12:33 -0700, Chris Rebert wrote: > > On Mon, Jul 26, 2010 at 4:03 AM, Sunny chilgod > > wrote: > >> Hi Chris, > >> Thanks for your help. but i need to to convert the whole string to int. > >> heres my full code, > >> ptid = 'item

Re: ValueError: invalid literal for int():

2010-07-26 Thread Steven D'Aprano
On Mon, 26 Jul 2010 04:12:33 -0700, Chris Rebert wrote: > On Mon, Jul 26, 2010 at 4:03 AM, Sunny chilgod > wrote: >> Hi Chris, >> Thanks for your help. but i need to to convert the whole string to int. >> heres my full code, >> ptid = 'item_01bom' >> so item_01bom is a field name in form, so i ge

Re: ValueError: invalid literal for int():

2010-07-26 Thread Chris Rebert
> On Mon, Jul 26, 2010 at 4:25 PM, Chris Rebert wrote: >> On Mon, Jul 26, 2010 at 3:25 AM, lee wrote: >> > Hi, >> > >> > I have a value, >> > >> > partintid = int(Screw plugg  (91_10 -> untitled)) >> > >> > but i get

Re: ValueError: invalid literal for int():

2010-07-26 Thread Sunny chilgod
27; Hence i get the error. hope i am clear now. - Sunny On Mon, Jul 26, 2010 at 4:25 PM, Chris Rebert wrote: > On Mon, Jul 26, 2010 at 3:25 AM, lee wrote: > > Hi, > > > > I have a value, > > > > partintid = int(Screw plugg (91_10 -> untitled)) > > &g

Re: ValueError: invalid literal for int():

2010-07-26 Thread Chris Rebert
On Mon, Jul 26, 2010 at 3:25 AM, lee wrote: > Hi, > > I have a value, > > partintid = int(Screw plugg  (91_10 -> untitled)) > > but i get ValueError: invalid literal for int(): Screw plugg  (91_10 - >> untitled) > any help? That is most certainly not your actu

ValueError: invalid literal for int():

2010-07-26 Thread lee
Hi, I have a value, partintid = int(Screw plugg (91_10 -> untitled)) but i get ValueError: invalid literal for int(): Screw plugg (91_10 - > untitled) any help? - Sunny -- http://mail.python.org/mailman/listinfo/python-list

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-05-28 Thread Kam-Hung Soh
Matthias Bläsing wrote: Am Wed, 28 May 2008 10:41:51 -0700 schrieb davidj411: I like the str2num function approach, but then i get left with a float that has more than 2 decimal spaces , i.e. 11.50 becomes 11.449 and round will not fix that. Welcome to the wonderful world of float

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-05-28 Thread Matthias Bläsing
Am Wed, 28 May 2008 10:41:51 -0700 schrieb davidj411: > I like the str2num function approach, but then i get left with a float > that has more than 2 decimal spaces , i.e. 11.50 becomes > 11.449 and round will not fix that. Welcome to the wonderful world of floating point numbers. For

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-05-28 Thread davidj411
On May 28, 2:22 am, Kam-Hung Soh <[EMAIL PROTECTED]> wrote: > David Jackson wrote: > > i used the csv module and saved its contents to a list. > > > ['Date', 'No.', 'Description', 'Debit', 'Credit'] > > ['3/17/2006', '5678', 'ELECTRONIC PAYMENT', '', '11.45'] > > ['3/04/2007', '5678', 'THE HOME DEP

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-05-27 Thread Kam-Hung Soh
David Jackson wrote: i used the csv module and saved its contents to a list. ['Date', 'No.', 'Description', 'Debit', 'Credit'] ['3/17/2006', '5678', 'ELECTRONIC PAYMENT', '', '11.45'] ['3/04/2007', '5678', 'THE HOME DEPOT 263 SomeCity FL', '', '25.40'] the credit/debit fields are strings. what

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-05-27 Thread Gabriel Genellina
En Tue, 27 May 2008 13:00:05 -0300, David Jackson <[EMAIL PROTECTED]> escribió: i used the csv module and saved its contents to a list. ['Date', 'No.', 'Description', 'Debit', 'Credit'] ['3/17/2006', '5678', 'ELECTRONIC PAYMENT', '', '11.45'] ['3/04/2007', '5678', 'THE HOME DEPOT 263 SomeCity

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-02-29 Thread George Sakkis
On Feb 28, 5:56 pm, davidj411 <[EMAIL PROTECTED]> wrote: > i am parsing a cell phone bill to get a list of all numbers and the > total talktime spend on each number. > > (snipped) > > I actually found a good solution. > (snipped) If you post 1-2 samples of the cell phone bill input, I am sure you

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-02-29 Thread D'Arcy J.M. Cain
On Fri, 29 Feb 2008 13:32:15 -0800 (PST) "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > You have to get rid of the double quotes first. > > you mean replace them with nothing? > > li[4].replace('"','') Sure, that will do. However, look at the csv module for another way of handling this.

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-02-29 Thread Terry Reedy
"davidj411" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |i am parsing a cell phone bill to get a list of all numbers and the | total talktime spend on each number. | | i already have a unique list of the phone numbers. | now i must go through the list of numbers and add up the tot

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-02-29 Thread [EMAIL PROTECTED]
> You have to get rid of the double quotes first. you mean replace them with nothing? li[4].replace('"','') once i do that, i should be able to use them as numbers. -- http://mail.python.org/mailman/listinfo/python-list

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-02-28 Thread Larry Bates
og\all_t_mob_nums.py", line 74, in > getsinglenumbertalktime('"800-218-2644"',talktime) > File "c:\path\inprog\all_t_mob_nums.py", line 66, in > getsinglenumbertalktime > newvar = int(li[5]) > ValueError: invalid literal for int() with base 1

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-02-28 Thread D'Arcy J.M. Cain
On Thu, 28 Feb 2008 14:56:10 -0800 (PST) davidj411 <[EMAIL PROTECTED]> wrote: > ValueError: invalid literal for int() with base 10: '"2"' > > > here is the question: > > How can i convert a string number like "2" to a true number that can

convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-02-28 Thread davidj411
type: "2"li[5] type: Traceback (most recent call last): File "", line 1, in File "c:\path\inprog\all_t_mob_nums.py", line 74, in getsinglenumbertalktime('"800-218-2644"',talktime) File "c:\path\inprog\all_t_mob_nums.py", line

Re: ValueError: invalid literal for int(): 1.0000000000e+00

2005-02-14 Thread Terry Reedy
the literal. If somestring is a non-decimal integer literal (something else), then radix is necessary, and not just helpful, for correct execution. >>> int('033') 33 >>> int('033', 8) 27 >>> int('1a3') Traceback (most recent call la

Re: ValueError: invalid literal for int(): 1.0000000000e+00

2005-02-14 Thread Fredrik Lundh
File "", line 1, in ? ValueError: invalid literal for int(): 1.0 >>> int("1e+10", 10) Traceback (most recent call last): File "", line 1, in ? ValueError: invalid literal for int(): 1e+10 >>> int("1.00e+10", 10) Traceback (most rece

Re: ValueError: invalid literal for int(): 1.0000000000e+00

2005-02-14 Thread Terry Reedy
) Traceback (most recent call last): File "", line 1, in ? ValueError: invalid literal for int(): 1.0 >>> int('1x') Traceback (most recent call last): File "", line 1, in ? ValueError: invalid literal for int(): 1x Terry J. Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: ValueError: invalid literal for int(): 1.0000000000e+00

2005-02-14 Thread Grant Edwards
On 2005-02-14, Martin MOKREJ© <[EMAIL PROTECTED]> wrote: > is this a bug or "feature" that I have to use float() to make int() > autoconvert > from it? It's a feature. Integers don't have decimal points... -- Grant Edwards grante Yow! I just had a NOSE

Re: ValueError: invalid literal for int(): 1.0000000000e+00

2005-02-14 Thread Fredrik Lundh
Martin MOKREJ© wrote: > is this a bug or "feature" that I have to use float() to make int() > autoconvert > from it? it's by design, of course. "1.00e+00" is not an integer. if you want to treat a floating point literal as an integer, you have to use an explicit conversion. --

ValueError: invalid literal for int(): 1.0000000000e+00

2005-02-14 Thread Martin MOKREJŠ
or "license" for more information. a = 1 "%5.10e" % (a) '1.00e+00' int("%5.10e" % (a)) Traceback (most recent call last): File "", line 1, in ? ValueError: invalid literal for int(): 1.00e+00 int(float("%5.10e" % (a))) 1 -- http://mail.python.org/mailman/listinfo/python-list