gpt4 book ai didi

python - 在 pythran 中使用日期时间

转载 作者:行者123 更新时间:2023-11-30 05:32:05 24 4
gpt4 key购买 nike

我正在使用 pythran,一个 Python 到 c++ 的编译器 http://pythran.readthedocs.io/

我们可以使用日期时间或任何其他方式在 pythran 函数中使用日期或时间信息吗?:

from datetime import datetime
print datetime.now()

我得到:

$ 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)

最佳答案

pythran 不支持 datetime 模块,这可以从错误消息中推断出来。解决方法是:

  • 从 python 代码调用 datetime 并将结果传递给 pythranized 函数
  • github page 上填写问题项目的。

关于python - 在 pythran 中使用日期时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35289562/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com