当前位置: 首页 > news >正文

古镇免费网站建设中小企业网站功能

古镇免费网站建设,中小企业网站功能,镇江网站建设门户报价,哪家公司产品设计的好实现 Python UDF 中的一步就是学习如何在 C 语言中调用 python 解析器。本文根据 Python 官方文档做了一次实验#xff0c;记录如下#xff1a; 1. 安装依赖包 $sudo yum install python3-devel.x86_642. 使用 python-config 来生成编译选项 $python3.6-config --cflags -…实现 Python UDF 中的一步就是学习如何在 C 语言中调用 python 解析器。本文根据 Python 官方文档做了一次实验记录如下 1. 安装依赖包 $sudo yum install python3-devel.x86_642. 使用 python-config 来生成编译选项 $python3.6-config --cflags --ldflags -I/usr/include/python3.6m -I/usr/include/python3.6m -Wno-unused-result -Wsign-compare -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE2 -fexceptions -fstack-protector-strong --paramssp-buffer-size4 -grecord-gcc-switches -m64 -mtunegeneric -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE2 -fexceptions -fstack-protector-strong --paramssp-buffer-size4 -grecord-gcc-switches -m64 -mtunegeneric -D_GNU_SOURCE -fPIC -fwrapv-L/usr/lib64 -lpython3.6m -lpthread -ldl -lutil -lm -Xlinker -export-dynamic3. 编写 Makefile 将第二步生成的编译、链接选项填到 Makefile 中得到 Makefile 如下 all:g -I/usr/include/python3.6m -I/usr/include/python3.6m -Wno-unused-result -Wsign-compare -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE2 -fexceptions -fstack-protector-strong --paramssp-buffer-size4 -grecord-gcc-switches -m64 -mtunegeneric -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE2 -fexceptions -fstack-protector-strong --paramssp-buffer-size4 -grecord-gcc-switches -m64 -mtunegeneric -D_GNU_SOURCE -fPIC -fwrapv -L/usr/lib64 -lpython3.6m -lpthread -ldl -lutil -lm -Xlinker -export-dynamic main.cpp4. 编写 main.cpp #define PY_SSIZE_T_CLEAN #include Python.hint main(int argc, char *argv[]) {wchar_t *program Py_DecodeLocale(argv[0], NULL);if (program NULL) {fprintf(stderr, Fatal error: cannot decode argv[0]\n);exit(1);}Py_SetProgramName(program); /* optional but recommended */Py_Initialize();PyRun_SimpleString(from time import time,ctime\nprint(Today is, ctime(time()))\n);if (Py_FinalizeEx() 0) {exit(120);}PyMem_RawFree(program);return 0; }5. 编译 $make g -I/usr/include/python3.6m -I/usr/include/python3.6m -Wno-unused-result -Wsign-compare -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE2 -fexceptions -fstack-protector-strong --paramssp-buffer-size4 -grecord-gcc-switches -m64 -mtunegeneric -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE2 -fexceptions -fstack-protector-strong --paramssp-buffer-size4 -grecord-gcc-switches -m64 -mtunegeneric -D_GNU_SOURCE -fPIC -fwrapv -L/usr/lib64 -lpython3.6m -lpthread -ldl -lutil -lm -Xlinker -export-dynamic main.cpp6. 执行 $./a.out Today is Wed Mar 1 14:23:13 2023后继章节预告 如何在脚本片段中使用第三方库如何传参到 Python 脚本如何处理 Python 脚本的返回值并发调用 Python 解析器效率讨论 参考文献 Embedding python in Chttps://docs.python.org/3/extending/embedding.html
http://www.hkea.cn/news/14482548/

相关文章:

  • 如何建设一个自己 的网站首页网站建设经典文章
  • 更新网站 是否要重启iis什么是电子商务模式
  • 做网站的案例太原网站建设公司招聘
  • 深圳网站设计公司 网络服务软件工程是干什么的
  • 帮别人做网站的公司是外包吗3d建模培训班一般多少钱
  • 网站改版设计流程大学校园网络设计方案
  • 手机网站域名和pc域名的区别Wordpress排版混乱
  • 美食网站建设的意义泰兴市住房和城乡建设局网站
  • 弹幕网站开发代码网站建设徐州
  • 左旗网站建设html网站开发代码
  • 建设企业网站需要使用哪些技术小型网站建设公司价格低
  • 网站建设流程与步骤兼职做视频的网站
  • 昌邑做网站企业网站后台
  • 班玛县公司网站建设网站建设规划方案制作
  • 文登做网站的公司苏州建设银行官方网站
  • 网站推广包年清理wordpress模板
  • 华宁县住房和城乡建设局网站美客多电商平台入驻链接
  • 网站建设的辅助软件wordpress的分类目录
  • 南坪网站建设做网站开发哪里好
  • 网站策划运营方案沈阳网站 房小二
  • 做a的网站有哪些建行官方网站 - 百度
  • 全国加盟网站大全网站开发技术报告模板
  • 网站上传该怎么做公司网站功能
  • 做暧暖ox免费网站织梦txt网站地图制作
  • 淘宝网站设计模板下载廊坊seo排名外包
  • 测网站打开的速度的网址iis5.1怎么发布网站
  • 免费在线网站建设网页版崩坏星穹铁道
  • 携程旅游电子商务网站策划书网站服务器速度对seo有什么影响
  • 学校网站建设多少钱o2o网站建设机构
  • 在线名片制作网站开发中国电信网站备案流程