程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> Python >> py2exe的使用基礎教程

py2exe的使用基礎教程

編輯:Python

創建一個setup.py,然後運行python setup.py py2exe即可

# -*- coding: utf-8 -*-
from distutils.core import setup
import glob
import py2exe
includes = ["encodings", "encodings.*","sip","PyQt4.QtCore",
"PyQt4.QtGui","codecs","codecs.*"]
options = {"py2exe":
{ "compressed": 1,
"optimize": 2,
"includes": includes,
#"bundle_files": 1
}
}
setup(
version = "0.1.0",
description = "hello",
name = "hello",
options=options,
#zipfile=None,
console=[{"script": "hello.py", "icon_resources": [(1, "yahoo.ico")]}],

)
setup(
version = "0.1.0",
description = "editor",
name = "editor",
options=options,
data_files=[("images",glob.glob("images\\*.*"))],
#zipfile=None,
windows=[{"script": "start.py", "icon_resources": [(1, "yahoo.ico")]}],

)

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved