在进行C语言编写的时候,因为一些需求,需要调用python的三方库,python程序已经写好了,但是不知道怎么在rt-thread中调用python程序。在网上查阅了其它关于C语言调用python的方法,但是试了很多都没有正确运行。
不知道有无大佬也做过同样的操作,望大佬帮助!
楼主,您好。
最近我也在同步在学习AliOS的SDK,它的SDK就移植了micropython这个非常强大的组件,详见:
AliOS-micropython
看他的特性还是不错的:
Features
The basic resource costs 110K for ROM, and 8.6K for RAM.
Basic futures can supports all boards whose hardware ROM and RAM resource can meet the needs.
“mpy_main” is the entry function for micropython. Calling mpy_main with no arguments will start basic cmds service. If you want to run a specific py script, argument argv is needed. And it should be used with filesystem to recognize the py file.
This future supports basic functions such as print、arithmetical and logic process、file and directory access and so on. Other supported futures depend on the realization of posix interface, which not support functions like pthread、signal and so on.
可以参考下,希望能够帮助到你。
谢谢,我去试试