[C++-sig] invalid literal for int()

Paul Grenyer paul at paulgrenyer.co.uk
Tue Mar 9 12:57:52 CET 2004


Hi All

I've got a bit of a weird one. I'm passing a string value my embedded 
python environment like this:

m_main_namespace[fieldDetails.name.c_str()] = str();

Where fieldDetails.name == "TITLE".

I am trying to convert the value of title to an integer inside the 
python code that is run in the embedded environment:

intValue = int( TITLE[0:2] )

but the error I get is: "invalid literal for int()".

Anyone know how I can solve this?

Regards
Paul

Paul Grenyer
Email: paul at paulgrenyer.co.uk
Web: http://www.paulgrenyer.co.uk

Have you met Aeryn: http://www.paulgrenyer.co.uk/aeryn/?
Version 0.3.0 beta now available for download.






More information about the Cplusplus-sig mailing list