国产成人AV无码一二三区,少女1到100集,国产精品久久久久精品综合紧,巜公妇之诱感肉欲HD在线播放

文章 > Python常见问题 > 别人怎么用我的Python程序

别人怎么用我的Python程序

头像

月亮邮递员

2020-03-23 17:38:484886浏览 · 0收藏 · 0评论

别人怎么用我的Python程序

这里讲的给别人用,不是指将你的代码开源,也不是指给另一个程序员用。比如你写了一个小工具,想给别人用,总不能叫别人也去装python吧。

让别人不装Python环境就可以使用Python编写的程序,可以将Python程序打包.exe可执行程序,然后发给他人。

推荐学习《Python教程》。

Python打包生成.exe文件的工具有:

1、py2exe

使用:

先写一个简单的脚本,文件名:helloworld.py

#!/usr/bin/env python  # -*- coding: utf-8 -*-  
  def say_hello(name):  
    print("Hello, " + name)
  if __name__ == "__main__":  
    name = input("What's your name:")
    say_hello(name)

还需要个用于发布程序的设置脚本:mysetup.py,在其中的 setup 函数前插入语句 import py2exe。

from distutils.core import setupimport py2exe
setup(console=["helloworld.py"])

2、cx_Freeze

使用:cxfreeze main.py --target-dir dist

Usage: cxfreeze [options] [SCRIPT]

Freeze a Python script and all of its referenced modules to a base
executable which can then be distributed without requiring a Python
installation.

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -O                    optimize generated bytecode as per PYTHONOPTIMIZE; use
                        -OO in order to remove doc strings
  -c, --compress        compress byte code in zip files
  -s, --silent          suppress all output except warnings and errors
  --base-name=NAME      file on which to base the target file; if the name of
                        the file is not an absolute file name, the
                        subdirectory bases (rooted in the directory in which
                        the freezer is found) will be searched for a file
                        matching the name
  --init-script=NAME    script which will be executed upon startup; if the
                        name of the file is not an absolute file name, the
                        subdirectory initscripts (rooted in the directory in
                        which the cx_Freeze package is found) will be searched
                        for a file matching the name
……
……
……

3、PyInstaller

使用:pyinstaller demo.py

微信截图_20200323173134.png

关注

关注公众号,随时随地在线学习

本教程部分素材来源于网络,版权问题联系站长!

无人区免费观看高清电视剧| 妈妈在家穿超薄内裤的注意事项| 他的手渐渐地也开始不安分起来| 日剧韩剧在线观看免费全集| 女生给男生吃小头头| 怀孕期间叫闺蜜来给老公消火| 粘液共生1~3集免费观看动漫| 《朋友的妈妈2》中字头歌词| 经典韩剧电影| 三男一女吃奶添下面| 电影《老公上班后》免费观看| 农村真实亲子乱子伦| 爱爱内含光| 夹子夹R头多久| 11人裸体航班女服务员是谁 | 《春闺梦里人》在线观看免费| 停电后我和公做了爱| 亲嘴扔衣服的视频| 激吻视频| 楼梯间的秘密小说BY赵景明| 麻豆免费无码AV在线播放| 四个人换着来免费观看第二季| 在线观看片免费人成视频| 四叔一次又一次索取怎么读| 法国《监狱伦理3》| 超星阅读平台登录入口| 国外成品网站1688入口在哪| 年轻的母亲2| 九九在线观看免费播放大全电视剧| 少女初恋吃小头头视频免费| 妈妈让我戴上避孕套读后感| 9.1国产NBA免费| 77777影院在线观看电视剧大..| 做到你合不拢腿为止| 美国灭火宝贝3| 成品人和精品人的区别在哪里知乎 | 久久午夜国产精品WWW| 熟母10和熟母10的区别| 免费观看已满十八岁电视剧美国| 成品网站1.1.719| 《明明说好要带避孕套了》中文版