Use datetime in pythran

I'm working with pythran, a Python to c++ compiler http://pythran.readthedocs.io/

Can we use datetime or any other way to use in pythran function a date or a time info ?:

from datetime import datetime
print datetime.now()

I get:

$ pythran ccompile.py 
ccompile.py None None
CRITICAL I am in trouble. Your input file does not seem to match    
Pythran's constraints...
E: Attribute 'now' unknown (ccompile.py, line 13)

Answers

The datetime module is not supported by pythran, as can be deduced from the error message. Workarounds are:

  • call datetime from the python code and pass the result to the pythranized function
  • fill an issue on the github page of the project.
Posted on by serge-sans-paille

Relevant tags