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

简述网站建设过程步骤广州最新通告

简述网站建设过程步骤,广州最新通告,php网站开发实训指导书,二级目录 WordpressCython不仅仅是一种编程语言。它的起源可以追溯到SAGE数学软件包#xff0c;它用于提高数学计算性能#xff0c;例如涉及矩阵的计算。更一般地说#xff0c;我倾向于将Cython视为SWIG的替代品#xff0c;为本机代码生成非常好的Python绑定。SWIG是最早和最好之一#xff0…Cython不仅仅是一种编程语言。它的起源可以追溯到SAGE数学软件包它用于提高数学计算性能例如涉及矩阵的计算。更一般地说我倾向于将Cython视为SWIG的替代品为本机代码生成非常好的Python绑定。SWIG是最早和最好之一用于生成多种语言的绑定的工具。 Cython仅限Python代码。通过生成语言绑定来处理遗留软件的很好方式对C / C 编写的遗留应用程序用Python添加新功能。第一章将专注于使用Cython的核心概念安装CythonHello World使用distutilsPython调用C函数类型转换安装Linux及Macpip install CythonLinux发行版本$ yum install cython# will work on Fedora and Centos$ apt-get install cython # will work on Debian based systems.Hello World!helloworld.pyx#!/usr/bin/env python3# -*- coding: utf-8 -*-# Author: xurongzhong#126.com# CreateDate: 2018-9-20# 技术支持qq群 144081101 591302926 567351477 钉钉免费群21745728print(Hello World from cython!)Makefileall:cython -3 -o helloworld.c helloworld.pyxgcc -g -O2 -fpic -c helloworld.c -o helloworld.o python3-config --cflagsgcc -g -O2 -shared -o helloworld.so helloworld.o python3-config --libsclean:rm -rf *.c *.o *.so build执行$ makecython -3 -o helloworld.c helloworld.pyxgcc -g -O2 -fpic -c helloworld.c -o helloworld.o python3-config --cflagsgcc -g -O2 -shared -o helloworld.so helloworld.o python3-config --libs$ pythonPython 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56)[GCC 7.2.0] on linuxType help, copyright, credits or license for more information. import helloworldHello World from cython!image.png使用distutils编译#!/usr/bin/env python3# -*- coding: utf-8 -*-# Author: xurongzhong#126.com# CreateDate: 2018-9-20# 技术支持qq群 144081101 591302926 567351477 钉钉免费群21745728from distutils.core import setupfrom Cython.Build import cythonizesetup(ext_modules cythonize(helloworld.pyx))执行$ python setup.py build_ext --inplacerunning build_extbuilding helloworld extensiongcc -pthread -B /usr/local/anaconda/compiler_compat -Wl,--sysroot/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/anaconda/include/python3.6m -c helloworld.c -o build/temp.linux-x86_64-3.6/helloworld.ogcc -pthread -shared -B /usr/local/anaconda/compiler_compat -L/usr/local/anaconda/lib -Wl,-rpath/usr/local/anaconda/lib -Wl,--no-as-needed -Wl,--sysroot/ build/temp.linux-x86_64-3.6/helloworld.o -o /home/andrew/code/cython-book/chapter1/helloworld/helloworld.cpython-36m-x86_64-linux-gnu.so$ pythonPython 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56)[GCC 7.2.0] on linuxType help, copyright, credits or license for more information. import helloworldHello World from cython!此处如果不添加 --inplace则编译在默认目录$ python setup.py build_extrunning build_extbuilding helloworld extensiongcc -pthread -B /usr/local/anaconda/compiler_compat -Wl,--sysroot/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/anaconda/include/python3.6m -c helloworld.c -o build/temp.linux-x86_64-3.6/helloworld.ogcc -pthread -shared -B /usr/local/anaconda/compiler_compat -L/usr/local/anaconda/lib -Wl,-rpath/usr/local/anaconda/lib -Wl,--no-as-needed -Wl,--sysroot/ build/temp.linux-x86_64-3.6/helloworld.o -o build/lib.linux-x86_64-3.6/helloworld.cpython-36m-x86_64-linux-gnu.so在root下面执行python3 setup.py install则会安装为系统库# python3 setup.py build_extrunning build_ext# python3 setup.py installrunning installrunning buildrunning build_extrunning install_libcopying build/lib.linux-x86_64-3.6/helloworld.cpython-36m-x86_64-linux-gnu.so - /usr/local/anaconda/lib/python3.6/site-packagesrunning install_egg_infoWriting /usr/local/anaconda/lib/python3.6/site-packages/UNKNOWN-0.0.0-py3.6.egg-infoPython调用C函数AddFunction.c#include int AddFunction(int x, int y) {printf(look we are within your c code!!\n);return x y;}AddFunction.h#ifndef __ADDFUNCTION_H__#define __ADDFUNCTION_H__extern int AddFunction(int, int);#endif //__ADDFUNCTION_H__PyAddFunction.pyx#!/usr/bin/env python3# -*- coding: utf-8 -*-# Author: xurongzhong#126.com# CreateDate: 2018-9-20# 技术支持qq群 144081101 591302926 567351477 钉钉免费群21745728cdef extern from AddFunction.h:cdef int AddFunction(int, int)def Add(a, b):return AddFunction(a, b)执行$ makecython -3 PyAddFunction.pyxgcc -g -O2 -fpic -c PyAddFunction.c -o PyAddFunction.o python3-config --includesgcc -g -O2 -fpic -c AddFunction.c -o AddFunction.ogcc -g -O2 -shared -o PyAddFunction.so AddFunction.o PyAddFunction.o python3-config --libs$ pythonPython 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56)[GCC 7.2.0] on linuxType help, copyright, credits or license for more information. from PyAddFunction import Add Add(1,2)look we are within your c code!!3参考资料
http://www.sadfv.cn/news/75993/

相关文章:

  • 建设通网站怎么投诉网站开发语言市场有率
  • 导航网站的网站地图怎么做昆明微网站搭建
  • 重庆城市建设网站如何让建设一个简单的网站
  • 河北涿州住房和城乡建设厅网站网站开发兼职团队
  • wordpress 自定义插件清远市企业网站seo
  • 万户网络网站顾问电子报刊的传播媒体是什么
  • seo网站推广首页排名找人做软件网站
  • 建站赚钱灰色做php网站会员开店代码如何编写
  • 班级网站建设需求分析麻涌建设网站
  • 无锡网站推广德令哈市公司网站建设
  • 郑州网站推广建设银行流水网站
  • 门户网站开发案例阿里云建站中级版和高级版
  • 网站前期策划短视频代运营费用明细
  • 湖南星大建设集团有限公司网站网站网页设计公司有哪些
  • 免费网站的软件wordpress三方登录
  • 泉州开发网站的公司有哪些南昌网站页面优化
  • 免费个人网站注册方法湛江seo代理商
  • 宣讲家网站 家风建设北京微网站制作价格
  • 东营建设信息网(东营市住房和城乡建设局)西安seo公司
  • 国内产品网站服务器租用
  • 网站模板 瀑布流购物网站建设开发费用分析
  • 河北做网站的公司达美网站建设
  • 网络系统管理技能大赛答案seo网络营销的技术
  • 网站建设合同 文库2018年公司网站建设费分录
  • 网站安全建设申请资阳房地产网站建设
  • 游戏网站开发公司互联网营销师培训班
  • 建设银行车贷网站wordpress账户插件
  • 一般做网站的软件wordpress去掉index
  • 哪个网站可以做中文云文字网站建设报价单-中英文版
  • 什么网站可以做软件有哪些内容吗济宁住房和城乡建设厅网站