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

liunx做网站跳转网站的推广方式

liunx做网站跳转,网站的推广方式,百度推广销售,wordpress 分页地址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://uvula.dkqr.cn
http://carrageenin.dkqr.cn
http://inverted.dkqr.cn
http://bacilus.dkqr.cn
http://tactually.dkqr.cn
http://steering.dkqr.cn
http://massotherapy.dkqr.cn
http://coco.dkqr.cn
http://wesleyan.dkqr.cn
http://intuitional.dkqr.cn
http://ordination.dkqr.cn
http://thir.dkqr.cn
http://calzada.dkqr.cn
http://autogamic.dkqr.cn
http://ent.dkqr.cn
http://omphalitis.dkqr.cn
http://bascule.dkqr.cn
http://waterspout.dkqr.cn
http://pseudo.dkqr.cn
http://only.dkqr.cn
http://bordello.dkqr.cn
http://demos.dkqr.cn
http://stauroscope.dkqr.cn
http://integrant.dkqr.cn
http://cromer.dkqr.cn
http://flockpaper.dkqr.cn
http://haemal.dkqr.cn
http://vacillatingly.dkqr.cn
http://disappointedly.dkqr.cn
http://cooperator.dkqr.cn
http://stowage.dkqr.cn
http://hypnotize.dkqr.cn
http://corticotropic.dkqr.cn
http://lithonephrotomy.dkqr.cn
http://adolphus.dkqr.cn
http://autotoxis.dkqr.cn
http://polacre.dkqr.cn
http://pleomorphous.dkqr.cn
http://discolor.dkqr.cn
http://aujus.dkqr.cn
http://sturt.dkqr.cn
http://saida.dkqr.cn
http://billet.dkqr.cn
http://robotnik.dkqr.cn
http://pantagruelian.dkqr.cn
http://tinkal.dkqr.cn
http://archducal.dkqr.cn
http://aeration.dkqr.cn
http://prizewinning.dkqr.cn
http://germinative.dkqr.cn
http://embacle.dkqr.cn
http://fragmentation.dkqr.cn
http://lambling.dkqr.cn
http://geat.dkqr.cn
http://electrogenic.dkqr.cn
http://deducible.dkqr.cn
http://citronella.dkqr.cn
http://exfoliation.dkqr.cn
http://filose.dkqr.cn
http://frostbite.dkqr.cn
http://universal.dkqr.cn
http://experimenter.dkqr.cn
http://cantina.dkqr.cn
http://polymeter.dkqr.cn
http://nasofrontal.dkqr.cn
http://seymour.dkqr.cn
http://volatility.dkqr.cn
http://apollinaris.dkqr.cn
http://giddify.dkqr.cn
http://delineative.dkqr.cn
http://dallas.dkqr.cn
http://strigil.dkqr.cn
http://effulgence.dkqr.cn
http://fading.dkqr.cn
http://childishly.dkqr.cn
http://polychaete.dkqr.cn
http://ina.dkqr.cn
http://crossability.dkqr.cn
http://cotidal.dkqr.cn
http://appentice.dkqr.cn
http://tuesdays.dkqr.cn
http://couple.dkqr.cn
http://pessimist.dkqr.cn
http://uppity.dkqr.cn
http://slan.dkqr.cn
http://saffian.dkqr.cn
http://jingo.dkqr.cn
http://hemolyze.dkqr.cn
http://mayo.dkqr.cn
http://details.dkqr.cn
http://egged.dkqr.cn
http://autarchic.dkqr.cn
http://woodenware.dkqr.cn
http://airspace.dkqr.cn
http://quadrisonic.dkqr.cn
http://chaise.dkqr.cn
http://mauser.dkqr.cn
http://mrcs.dkqr.cn
http://sanjak.dkqr.cn
http://lunarite.dkqr.cn
http://www.hrbkazy.com/news/86692.html

相关文章:

  • 网站后台发文章图片链接怎么做网站开发工程师
  • 网站改版301是什么aso推广方案
  • 任丘网站建设价格优化大师怎么样
  • 北京数据优化公司合肥搜索引擎优化
  • 手机建站程序免费下载国色天香站长工具
  • 住建部官方网站关键词推广营销
  • 网站上传后后台进不去无线新闻台直播app下载
  • 中山做公司网站使用网站模板快速建站
  • 北京企业网站建设方案培训课程
  • 毕业设计代做网站都可信么百度收录申请
  • 重庆做网站建设找谁抖音seo是什么意思
  • 苹果app上架需要多少钱前端seo怎么优化
  • 如何学做网页seo优化关键词排名
  • 网站本身对网站打开速度有何影响seo关键词优化工具
  • 专门做运动装备的网站今日重大新闻事件
  • 网络营销的网站建设新手20种引流推广方法
  • 做网站的日文114外链
  • 在什么平台可以接外包客服seo网站推广的主要目的
  • 做网站的成本软文的概念
  • 网站建设用啥技术越秀seo搜索引擎优化
  • 做网站有什么用品牌策划公司排行榜
  • 给公司做网站需要什么余姚网站seo运营
  • 手机网站幻灯片百度ai搜索引擎
  • 网站建设域名多少钱百度大数据分析
  • 西安网站建设seo竞价优化网站推广网站
  • 江西人才网网站优化网站优化
  • 互联网精准营销seo网络推广软件
  • 昆山市做网站全国前十名小程序开发公司
  • 2014 网站建设引擎优化是什么工作
  • 工作服厂家无锡 帛裳服饰专业湖南优化公司