Python date time API

R

rk

Hi,

I am python novice, trying to convert a boost::gregorian::date out to
python using PyDateTime C-api interface. I was coring because the C-
API failed to initialize. The error was:

AttributeError: "module" object has not attribute datetime_CAPI

As indicated by the error, a dir(datetime) gives me the following
output.

['MAXYEAR', 'MINYEAR', '__doc__', '__file__', '__name__', 'date',
'datetime', 'time', 'timedelta', 'tzinfo']

I am note sure why datetime_CAPI is missing? I would appreciate any
input.

Regards,
Ramesh
 
J

Jason Scheirer

Hi,

 I am python novice, trying to convert a boost::gregorian::date out to
python using PyDateTime C-api interface. I was coring because the C-
API failed to initialize. The error was:

AttributeError: "module" object has not attribute datetime_CAPI

As indicated by the error, a dir(datetime) gives me the following
output.

['MAXYEAR', 'MINYEAR', '__doc__', '__file__', '__name__', 'date',
'datetime', 'time', 'timedelta', 'tzinfo']

I am note sure why datetime_CAPI is missing? I would appreciate any
input.

Regards,
Ramesh

You MUST use the PyDateTime_IMPORT; macro at the top ov EVERY scope in
which you are using the DateTime C API.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top