pythonc++pythran

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)

Solution

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