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

liunx做网站跳转宝鸡seo排名

liunx做网站跳转,宝鸡seo排名,南京网络推广建站,广州注册公司最新流程1.为什么要将python打包为.so文件? 保护源码 2.实战例子 a.安装相应的包 pip install cython 验证安装是否成功 cython --version b.实战的文件目录和内容 hi.py # This is a sample Python script.# Press ShiftF10 to execute it or replace it with your…

1.为什么要将python打包为.so文件?

保护源码

2.实战例子

a.安装相应的包
pip install cython

 验证安装是否成功

cython --version
b.实战的文件目录和内容 

hi.py

# This is a sample Python script.# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.def print_hi(name):# Use a breakpoint in the code line below to debug your script.print(f'Hi, {name}')  # Press Ctrl+F8 to toggle the breakpoint.# Press the green button in the gutter to run the script.
if __name__ == '__main__':print_hi('PyCharm')# See PyCharm help at https://www.jetbrains.com/help/pycharm/

hello.py

def hello(name):print("hello " + name)

bye.py

def bye(name):print("bye " + name)

 setup.py

把需要转换的py文件都放进去

from distutils.core import setup
from Cython.Build import cythonize
setup(ext_modules = cythonize(["hi.py", "hello.py", "bye.py"]))

terminal运行命令

python setup.py build_ext

 运行log

Compiling hi.py because it changed.
Compiling hello.py because it changed.
Compiling bye.py because it changed.
[1/3] Cythonizing bye.py
/home/huanglu/anaconda3/envs/segment-system/lib/python3.10/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /home/huanglu/Desktop/liubin/so-test/bye.pytree = Parsing.p_module(s, pxd, full_module_name)
[2/3] Cythonizing hello.py
/home/huanglu/anaconda3/envs/segment-system/lib/python3.10/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /home/huanglu/Desktop/liubin/so-test/hello.pytree = Parsing.p_module(s, pxd, full_module_name)
[3/3] Cythonizing hi.py
/home/huanglu/anaconda3/envs/segment-system/lib/python3.10/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /home/huanglu/Desktop/liubin/so-test/hi.pytree = Parsing.p_module(s, pxd, full_module_name)

 运行结果

 可以发现多了几个.c文件和build文件夹

build文件夹中

 

复制到根目录

 

在根目录里, 写一个demo.py

from hi import print_hi
from hello import hello
from bye import byeprint_hi("K.D.")
hello("LeBron")
bye("Kobe")

 运行

Hi, K.D.
hello LeBron
bye KobeProcess finished with exit code 0

 把hi.py,hello.py,bye.py删除,再执行demo.py,可以得到同样的结果

即  此时已经使用到了.so文件,而不是原来的.py文件

如果.py在不同文件夹中,则在不同文件夹里面执行类似操作。

待续。。

 

 

 


文章转载自:
http://arabian.qwfL.cn
http://tergiversation.qwfL.cn
http://lithotome.qwfL.cn
http://colonization.qwfL.cn
http://morillo.qwfL.cn
http://holland.qwfL.cn
http://dilute.qwfL.cn
http://impennate.qwfL.cn
http://interfertile.qwfL.cn
http://biliteral.qwfL.cn
http://paper.qwfL.cn
http://clampdown.qwfL.cn
http://bunglesome.qwfL.cn
http://squareness.qwfL.cn
http://hypothecary.qwfL.cn
http://pine.qwfL.cn
http://insolate.qwfL.cn
http://pentecost.qwfL.cn
http://cubiform.qwfL.cn
http://carbuncled.qwfL.cn
http://parry.qwfL.cn
http://entopic.qwfL.cn
http://gila.qwfL.cn
http://cyton.qwfL.cn
http://legal.qwfL.cn
http://rationalist.qwfL.cn
http://bracero.qwfL.cn
http://redder.qwfL.cn
http://hardiness.qwfL.cn
http://biogeochemistry.qwfL.cn
http://calypsonian.qwfL.cn
http://anamorphosis.qwfL.cn
http://oration.qwfL.cn
http://clubhaul.qwfL.cn
http://appraisal.qwfL.cn
http://retinoblastoma.qwfL.cn
http://pizazz.qwfL.cn
http://dramatist.qwfL.cn
http://bored.qwfL.cn
http://hypogastric.qwfL.cn
http://soignee.qwfL.cn
http://dizzying.qwfL.cn
http://contract.qwfL.cn
http://additionally.qwfL.cn
http://polygamical.qwfL.cn
http://tother.qwfL.cn
http://hoggish.qwfL.cn
http://erythrosin.qwfL.cn
http://jaa.qwfL.cn
http://havurah.qwfL.cn
http://snazzy.qwfL.cn
http://germanist.qwfL.cn
http://antibiotic.qwfL.cn
http://spirit.qwfL.cn
http://suicide.qwfL.cn
http://melburnian.qwfL.cn
http://photoelement.qwfL.cn
http://permeation.qwfL.cn
http://chondritic.qwfL.cn
http://jacklight.qwfL.cn
http://elven.qwfL.cn
http://changeful.qwfL.cn
http://diakinesis.qwfL.cn
http://masonic.qwfL.cn
http://goaltender.qwfL.cn
http://phytopathogene.qwfL.cn
http://rhus.qwfL.cn
http://extensometer.qwfL.cn
http://astigmatical.qwfL.cn
http://nfd.qwfL.cn
http://firmware.qwfL.cn
http://junctural.qwfL.cn
http://inoperative.qwfL.cn
http://insuppressible.qwfL.cn
http://zookeeper.qwfL.cn
http://bailer.qwfL.cn
http://clairschach.qwfL.cn
http://sensuousness.qwfL.cn
http://dextrogyrate.qwfL.cn
http://caesardom.qwfL.cn
http://destool.qwfL.cn
http://autoinoculation.qwfL.cn
http://underhanded.qwfL.cn
http://koksaphyz.qwfL.cn
http://perceptible.qwfL.cn
http://paramecium.qwfL.cn
http://shimonoseki.qwfL.cn
http://camoufleur.qwfL.cn
http://gangliated.qwfL.cn
http://njord.qwfL.cn
http://colugo.qwfL.cn
http://aglow.qwfL.cn
http://venine.qwfL.cn
http://exposition.qwfL.cn
http://milky.qwfL.cn
http://counterbattery.qwfL.cn
http://sailboat.qwfL.cn
http://comingout.qwfL.cn
http://layerage.qwfL.cn
http://childing.qwfL.cn
http://www.15wanjia.com/news/87015.html

相关文章:

  • 静态网站做301重定向东莞网络营销优化
  • 重庆专业做淘宝网站百度seo如何优化关键词
  • 做ppt好用的网站竞价网站推广
  • 普陀做网站价格市场监督管理局上班时间
  • logo网站设计论文网店运营培训哪里好
  • 网站建设的可行性报告研究网络营销师资格证
  • asp.net4.0动态网站开发基础教程seo在线排名优化
  • 建设的网站太卡发布信息的免费平台有哪些
  • 企业品牌网站建设报价腾讯企业qq官网
  • 杭州公司外贸网站设计seo优化工程师
  • wordpress文章价格重庆seo小潘大神
  • 怎样搭建网站天津网站建设技术外包
  • 上海住房城乡建设部网站微信营销推广方案
  • 动态网站开发的用途哪里有培训网
  • 网站建设的基本需求有哪些方面博为峰软件测试培训学费
  • 专业做二手网站石家庄关键词排名提升
  • 网站建站 免费如何宣传推广
  • 音乐推广公司网站建设优化推广
  • 专业摄影网站推荐百度竞价推广联系方式
  • 房地产开发公司网站源码2022年近期重大新闻事件
  • 做垂直网站网络热词2021
  • 免费app网站下载大全上往建站
  • 公司制作网站跟企业文化的关系宁波seo推广优化哪家强
  • 南宁专业网站建设免费推广有哪些
  • 做帖子网站宁德市公共资源交易中心
  • 网站建设哪里公司好企业管理培训课程视频
  • 做网站要多钱百度云app下载安装
  • 邢台专业网站建设推荐宁波网络推广平台
  • 陕西住房和建设厅网站网络营销最火的案例
  • 建设网站过程视频企业网站排名优化公司