py2exe

Make a py2exe exe run without a console?

末鹿安然 提交于 2019-11-27 08:24:14
Does anyone know how to make an exe with py2exe run without the black console? and bundle up all the pyd files etc into just one exe file? Joel Christophel For one exe file, use this setup (taken from this answer ): from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') setup( options = {'py2exe': {'bundle_files': 1, 'compressed': True}}, windows = [{'script': "single.py"}], zipfile = None, ) from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') setup( windows = [{'script': "pytho.py"}], ) edited for py2exe x64 support 64-bit does not have

Using #-*- coding: utf-8 -*- does not remove “Non-ASCII character '\x90' in file hello.exe on line 1, but no encoding declared” error

半腔热情 提交于 2019-11-27 07:24:36
问题 I'm trying to convert a python file into an executable. So far so good. But when I try to run the executable I get the following error message: SyntaxError: Non-ASCII character '\x90' in file hello.exe on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details" This problem is widely documented, but using the given solution of adding #-*- coding: utf-8 -*- at the start of the line is not solving my issue. I'm using Notepad++ editor and have even enforced the

Py2Exe “Missing Modules”

半城伤御伤魂 提交于 2019-11-27 06:47:42
问题 I'm trying to convert my python project into an exe using Py2Exe. It is worth noting that cx_freeze complains about the same three "missing modules", along with several dozen others. The problem is, no one anywhere tells how to resolve this. I'm building on MS Windows XP 32-bit (VirtualBox). C:\Documents and Settings\Jason\Desktop\redstring2>python setup.py py2exe running py2exe running build_py creating build creating build\lib copying redstring.py -> build\lib 3 missing Modules ------------

making exe file from python that uses command line arguments

♀尐吖头ヾ 提交于 2019-11-27 05:21:26
I want to create an exe from a python script that uses command line arguments (argv) From what I've seen py2exe doesn't support command-line-arguments What can I do? EDIT: I was using a GUI2Exe tool, so I just missed the Console flag, but the accepted answer is perfectly correct setup(console=['hello.py']) I believe the line you want to use looks like this. I tested this with 2 files: hello.py import sys for arg in sys.argv: print arg print "Hello World!" And setup.py from distutils.core import setup import py2exe setup(console=['hello.py']) I ran these commands: python setup.py py2exe And

Hiding console window of Python GUI app with py2exe

淺唱寂寞╮ 提交于 2019-11-27 04:24:36
I have a Python program uses Qt (PyQt4 in fact) and when I launch it from its main.py, I get a console window and the GUI window (on Windows, of course). Then I compile my program with py2exe and main.exe is successfully created. However, if I run main.exe (this is what users of program will do) console window of Python still appears and all my debug text is stdout-ed to that window. I want to hide cmd line window when my application is running and I want just my GUI to be visible to the user when executed from .exe file. Is that possible? Yep, it is possible. If I use setup(console=['__main__

Opening an EXE of my Pygame program gives me import errors

你。 提交于 2019-11-27 03:06:37
问题 I made an MP3 player with pygame code: from Tkinter import * import pygame import glob import tkFont songs=[] for x in glob.glob('C:\WhaleTunes\Downloaded/*mp3'): songs.append(x) Admin=Tk() num=0 plpa=-1 songas=Label(Admin,text='',bg='red') songas.place(relx=0.0,rely=0.7) def play(number): pygame.mixer.music.unpause() pygame.mixer.music.load(songs[number]) pygame.mixer.music.play() songas.configure(text=songs[number]) def pause(): pygame.mixer.music.pause() def Pre(): global num if num == 0:

Are there any alternatives to py2exe? [closed]

好久不见. 提交于 2019-11-27 02:46:05
Are there any alternatives to py2exe? cx_Freeze is cross-platform and does the same, or you could use py2app , which works on mac only. Alex Martelli pyInstaller is cross-platform and very powerful, with many third-party packages (matplotlib, numpy, PyQT4, ...) specially supported "out of the box", support for eggs, code-signing on Windows (and a couple other Windows-only goodies, optional binary packing... the works!-) The one big issue: the last "released" version, 1.3, is ages-old -- you absolutely must install the SVN trunk version, svn co http://svn.pyinstaller.org/trunk pyinstaller (or

Can 64-bit python create 32-bit Windows executables

我们两清 提交于 2019-11-27 02:34:39
问题 I have a new 64-bit Windows machine and use python for various things and so would prefer to install 64-bit python. However, one of my python projects creates a Windows executable that is then run on a 32-bit Windows machine (created using py2exe). How do I use 64-bit python and py2exe to create a 32-bit executable? If I can't do that, I guess my choices are: Use 32-bit python on all machines including mine; or Install python on the 32-bit machines and don't use py2exe. Any advice much

Enabling JPEG support for QImage in py2exe-compiled Python scripts?

假如想象 提交于 2019-11-27 01:53:09
I'm trying to use a JPEG image in a QImage object from a Python script, with PyQt4. The script itself works perfectly, the image loads and can be manipulated and rendered and all. However, when I try to "compile" this script with py2exe, everything works but the JPEG image. Replacing it with a PNG equivalent works, but since my program downloads images from the web, they won't always be in PNG format and I can't afford converting them all with another library. I've discovered that JPEG image support for QImage, along with other image formats, is provided by some DLLs in the \qt\plugins

Running compiled python (py2exe) as administrator in Vista

帅比萌擦擦* 提交于 2019-11-27 01:46:46
Is it possible to programaticly run compiled Python (comiled via py2exe) as administrator in Vista? Some more clarification: I have written a program that modifies the windows hosts file (c:\Windows\system32\drivers\etc\hosts) in Vista the program will not run and will fail with an exception unless you right-click and run as administrator even when the user has administrator privileges, unlike in XP where it will run if the user has administration rights, so I need a way to elevate it to the correct privileges programaticly. Do you mean that you want Windows to prompt for elevation when your