创建python应用程序的可执行文件

2024-03-28 09:33:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我想创建一个可以在ubuntu机器上运行的python应用程序的可执行文件。你知道吗

Python setuptools有用于windows(bdist\u wininst)和rmp(bdist\u rpm)的选项,但是我在用于ubuntu或debian的Python setuptools中找不到任何选项。你知道吗

还有一个选项“bdist\u dumb”,但我不知道它的用途。你知道吗

问题:

  1. 如何使用python设置工具创建ubuntu可执行文件?你知道吗
  2. pyinstaller与setuptools有何不同?我应该使用哪种工具?你知道吗

Tags: 工具机器应用程序可执行文件ubuntuwindows选项debian
1条回答
网友
1楼 · 发布于 2024-03-28 09:33:48

stdeb可能就是您要找的,它还可以与distutils一起使用,这与setuptools类似。下面是一个来自their repo的简单示例:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from distutils.core import setup
import sys
setup(name='simple_pkg',
      packages=['simple_pkg'],
      version='0.1',
      author='Mister Unicodé',
      author_email='mister.unicode@example.tld',
      description='Python package with Unicodé fields',
      long_description='This is a Python package with Unicodé data.',
)

相关问题 更多 >