将包含媒体内容的python文件转换为.exe

时间:2017-02-20 20:34:02

标签: python

我试图通过py2exe将.py文件转换为.exe文件。

这是我的剧本:

from distutils.core import setup
import py2exe

 setup(name="Hyper Operating System",
      description="Private OS system",

scripts=[r"c:\users\neel-_000\desktop\python\login\login2.py"],
data_files=[(r"c:\users\neel-_000\desktop\python\login",
           [r"c:\users\neel-_000\desktop\python\login\012_restart- 128.png"]), (
          r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\account.png"]),
          (r"c:\users\neel-_000\desktop\python\login",
           [r"c:\users\neel-_000\desktop\python\login\background.png"]), (
          r"c:\users\neel-_000\desktop\python\login",
          [r"c:\users\neel-_000\desktop\python\login\background1.png"]), (
          r"c:\users\neel-_000\desktop\python\login",
          [r"c:\users\neel-_000\desktop\python\login\calendar.png"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\check.png"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\com.png"]), (
          r"c:\users\neel-_000\desktop\python\login",
          [r"c:\users\neel-_000\desktop\python\login\computer.png"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\custom.py"]),
          (r"c:\users\neel-_000\desktop\python\login",
           [r"c:\users\neel-_000\desktop\python\login\download.jpg"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\file.png"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\file1.png"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\files.png"]),
          (r"c:\users\neel-_000\desktop\python\login",
           [r"c:\users\neel-_000\desktop\python\login\firewall.png"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\icon.ico"]), (
          r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\install.png"]),
          (r"c:\users\neel-_000\desktop\python\login",
           [r"c:\users\neel-_000\desktop\python\login\installed.png"]), (
          r"c:\users\neel-_000\desktop\python\login",
          [r"c:\users\neel-_000\desktop\python\login\internet.png"]), (
          r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\loading.gif"]),
          (r"c:\users\neel-_000\desktop\python\login",
           [r"c:\users\neel-_000\desktop\python\login\loading2.gif"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\login.png"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\login2.py"]),
          (
          r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\manager.png"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\menu.png"]), (
          r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\notepad.png"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\open.png"]), (
          r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\options.png"]),
          (r"c:\users\neel-_000\desktop\python\login",
           [r"c:\users\neel-_000\desktop\python\login\password.png"]), (
          r"c:\users\neel-_000\desktop\python\login",
          [r"c:\users\neel-_000\desktop\python\login\password_database.txt"]), (
          r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\restart.png"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\search.png"]),
          (
          r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\setting.png"]),
          (r"c:\users\neel-_000\desktop\python\login",
           [r"c:\users\neel-_000\desktop\python\login\shutdown.png"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\signup.png"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\store.png"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\test.py"]), (
          r"c:\users\neel-_000\desktop\python\login",
          [r"c:\users\neel-_000\desktop\python\login\testcustom.py"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\tm.png"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\update.png"]),
          (r"c:\users\neel-_000\desktop\python\login",
           [r"c:\users\neel-_000\desktop\python\login\user-sign.png"]), (
          r"c:\users\neel-_000\desktop\python\login",
          [r"c:\users\neel-_000\desktop\python\login\username.png"]), (
          r"c:\users\neel-_000\desktop\python\login",
          [r"c:\users\neel-_000\desktop\python\login\user_signup.png"]),
          (r"c:\users\neel-_000\desktop\python\login", [r"c:\users\neel-_000\desktop\python\login\wifi.png"])],

) 但是,每次运行程序时,我都会收到此错误代码:

  usage: test.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
  or: test.py --help [cmd1 cmd2 ...]
  or: test.py --help-commands
  or: test.py cmd --help

错误:未提供任何命令 提前致谢!如果有人可以编辑脚本并重新发布它,那将是惊人的

1 个答案:

答案 0 :(得分:-1)

PyInstaller可能是要走的路。