ds python 导入数学模块
我正在尝试让我之前在 Windows 上编写的一些 python 代码在我的 DS 上运行。我正在使用 (DSPython),当我尝试导入数学时,它失败了“导入错误:没有名为数学的模块”。我已经获得了我需要的几乎所有其他模块,这些模块不依赖于数学工作。但 math 通常是一个内置模块,所以我不能只在我的电脑上找到 math.py 并将其复制过来。关于在哪里可以找到仍然可以执行相同功能的内置数学模块的替代方案,有什么建议吗?
I'm trying to get some python code I've written earlier on Windows to work on my DS. I'm using (DSPython), and when I tried to import math, it failed with "ImportError: No module named math". I've gotten most all other modules I need that don't rely on math working. But math is normally a builtin module, so I can't just find math.py on my PC and copy it over. Any suggestions on where I can find an alternative to the builtin math module that can still perform the same functions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
上个月 dspython 进行了整体项目清理,并解决了几个问题,包括您提到的问题,在此过程中得到解决。
如果您仍然有兴趣在 DS 中运行该 Python 代码,那么现在是再试一次的好时机。贡献者还编写了一些小示例程序,它们是您使用的良好起点 - 它们还可以让您了解到目前为止已实现的内容。
Last month dspython has been given an overall project cleanup, and several issues, including the one you mention, were addressed in the process.
If you're still interested in running that Python code in your DS, this is a good time to try again. A contributor has also written some small example programs, that are good starting points for you to use - they also can give you an idea of what's implemented so far.
您最好的选择是使用 Pyrex 包装 NDS c 库,并创建您自己的数学模块。 dspython 的其余部分是。
Your best bet would be to wrap the NDS c library with pyrex, and create your own math module. The rest of dspython is.