py2exe

Limit number of class instances with python

南楼画角 提交于 2019-12-07 10:57:57
问题 Μy Mainclass creates a simple QmainWindows like this: class mcManageUiC(QtGui.QMainWindow): def __init__(self): super(mcManageUiC, self).__init__() self.initUI() def initUI(self): self.show() And at the end of my file I launch it like this: def main(): app = QtGui.QApplication(sys.argv) renderManagerVar = mcManageUiC() sys.exit(app.exec_()) if __name__ == '__main__': main() My problem is that each time i source it, it launches a new window. I would like to know if there is a way to detect

py2exe doesn't import the os module?

丶灬走出姿态 提交于 2019-12-07 09:32:26
So, basically, I'm trying to make my Python 2.7 script into an EXE. Here is my setup.py: from distutils.core import setup import py2exe import os setup( options = { "py2exe":{ "includes": ["os"] } }, name = "Anansi CalcPad", version = "0.35", description = "Anansi CalcPad is a three-tiered application that provides a journal, calculator, and news aggregator in one.", author = "Cody Dostal", author_email = "cody@seafiresoftware.org", url = "http://seafiresoftware.org/wordpress/anansi-calcpad/", windows = ["AnansiCalc.py"], ) If there is indentation problems, it was caused by a bad copy on

py2exe error handling redirection and popup

笑着哭i 提交于 2019-12-07 03:40:01
问题 Been trying to figure out how to get py2exe to handle errors more gracefully. There are basically 2 weird things happening: 1) Popup message after shutting down the program => want to suppress (not show up) this popup Use try/except => doesn't work http://osdir.com/ml/python.py2exe/2006-09/msg00016.html Not sure where to put this code 2) Log file getting created in c:\Program Files\AppName\AppName.exe.log (sometimes has permission errors writing to this folder) => redirect log to c:

cx_freeze how to include 3rd party modules, ImportError: No module named progressbar

邮差的信 提交于 2019-12-07 02:34:06
问题 i came across a problem when using cx_freeze, how to "include" 3rd party modules or packages ? according to the doc , it seems easy but ... my env : win7 x64 python 2.7.5 x64 here is my setup.py #!/usr/bin/env python2 from cx_Freeze import setup, Executable includefiles = [] includes = [] excludes = [] packages = ["lxml","lxml._elementpath","lxml.etree","lxml.html",'selenium','jinja2', "progressbar"] setup( name = 'myTool', version = '0.1', description = 'Brought to you by xxx', author =

Using Py2Exe without command line

陌路散爱 提交于 2019-12-06 21:10:33
Is it possible to compile a python script with py2exe without calling py2exe from the command line? >Python setup.py py2exe I'd like to run it all from a script, but haven't found a way to do so. at the beginig of the setup.py import sys if len(sys.argv) == 1: sys.argv.append("py2exe") this way, if setup.py is called without args or with a double click, it will start the packaging 来源: https://stackoverflow.com/questions/15551527/using-py2exe-without-command-line

Convert Python Script to .exe that will work on all/most versions of Windows

社会主义新天地 提交于 2019-12-06 15:51:37
I am aware how to convert a Python script to an Windows Executable file(.exe) using Py2Exe, PyInstaller and etc. But is there a way to convert a Python script to an .exe that will work on all the following versions of Windows: Windows XP to Windows 8? Keep in mind my Python script is very simple and does NOT use any libraries like pyGTK or wxPython. Its just a simple console script that lists all files in a directory and writes it to a file. So if I were to compile the following script using Py2Exe on my Windows 7 64bit computer, would that .exe work on ALL the following versions of Windows:

Python安装py2exe(Python2安装py2exe)

99封情书 提交于 2019-12-06 15:33:39
py2exe相信大家都知道,一个能够打包Python程序变成可执行文件的Python库。用起来很简单,但是好像还是有限,像opencv这样的库还是没有办法打包等。我安装的时候遇到了一小点问题,分享给大家: Python3 安装py2exe 安装直接使用 pip install py2exe Python2安装py2exe python2安装的时候无法直接使用pip install py2exe, 方法如下: pip install https://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.zip/download 后面的网址是官网的网址 安装时会报错,需要下载安装Microsoft C++ 9.0,下载地址为http://aka.ms/vcpython27,下载VCForPython.msi安装即可 来源: CSDN 作者: my_chen_hust 链接: https://blog.csdn.net/zseqsc_asd/article/details/84192398

Python: PyQt4 Py2exe

女生的网名这么多〃 提交于 2019-12-06 14:46:44
Greetings! So I've made a Python application that uses the ever so great PyQt as it's interface. Now if I was to specify the --bundle 0 option for Py2Exe the resulting compiled executable file works fine! But with all the needed files, the folder gets cluttered up. So I tried passing 1 and 2 for the --bundle option. One packs everything into file file whilst the other packs everything except the Python dll. However both of those options results in the executable file exiting upon execution. No errors are chucked back. Another question on stackoverflow said to supply the "--includes sip"

Look of the app - Py2exe / wxPython

£可爱£侵袭症+ 提交于 2019-12-06 13:53:51
So my problem is the look and feel from my application, as it looks like an old look app. It is an wxPython application, and on python it runs fine and looks fine, but when I convert it to .exe using py2exe, the look is just bad. Now I know that if you are using XP you need some manifest to correct it but I am in other circumstances. I'm using Windows 7, and I'm using Python 2.6 (Yes, I am including the DLL's and the Microsoft.VC90.CRT.manifest). So my question is how can I solve this under these circumstances? NOTE: I tried to search on google, but the posts I found were rather old with

py2exe - “The following modules appear to be missing”

耗尽温柔 提交于 2019-12-06 12:27:28
First time using stackoverflow so go easy please. I used py2exe before on my old computer and it worked fine. Unfortunately when trying to use it on my new one the exe. file just doesn't work. I get these errors when trying to convert the .py file. My setup .py from distutils.core import setup import py2exe setup(windows=['Test.py']) My Test.py to convert to exe. def Test(): print 'TEST' Test() The Errors I receive: The following modules appear to be missing ['IronPythonConsole', 'System', 'System.Windows.Forms.Clipboard', '_scproxy', 'c lr', 'console', 'modes.editingmodes', 'pyreadline