Reputation: 1155
I want to generate for Windows platform the executable file of my Python GUI application.
- I'm using two .py OO scripts
- The first script (processcls.py) contains this header:
from lxml import html
from urllib import urlopen
import os, re, sys, time
- The second script contains this header:
from processcls import *
from Tkinter import *
import Queue, threading, tkFileDialog, ttk, tkMessageBox, win32clipboard
- And this is my py2exe script. The problem is that I can't see any GUI created. So I don't clear know where is my mistake in the code.
from distutils.core import setup
import py2exe
setup(
name='MyApplic',
author='amazon',
author_email='[email protected]',
windows=[
{
'script':"init.py",
'uac_info': "requireAdministrator","icon_resources": [(1, "favicon.ico")]
}
],
options=
{
'py2exe':{
'includes': ['lxml.etree', 'lxml._elementpath', 'gzip', 'processcls'],
'packages': ['lxml', 'urllib', 'Tkinter'],
'bundle_files': 1,
'compressed' : True
}
},
zipfile = None
)
Any suggestions? I'm using Tkinter as a GUI gramework and Python 2.7
Thanks Migrome
Upvotes: 1
Views: 9388
Reputation: 557
All credits to https://www.youtube.com/watch?v=OZSZHmWSOeM
If you are unable to run the pip command, follow this guide:
cd C:\Program Files\auto py to exe
pip install -r requirements.txt
python run.py
An "Auto Py To Exe" GUI should appear in the screen.
Select your .py file or paste the path on "Script Location"
Select One File mode.
If you are using a GUI like Tkinter, select "Window Based (Hide the console)". If not, select "Console Based"
Select an icon if you want and select additional files if the code has external files.
In "Advanced", select the output folder.
Click on the "CONVERT .PY TO .EXE" BUTTON. When the process has finished, you'll have a .exe file in your output folder. Execute-it. It should work exactly as the .py other.
Upvotes: 0
Reputation: 557
go to cmd and type
pip install auto-py-to-exe
wait until it finishes, and then, run
auto-py-to-exe
on cmd. A GUI should appear. Follow the instructions given.
Upvotes: 3