Comments (9)
Regarding that the python script runs properly by itself then this may have been caused by incorrect configuration or third party modules.
The best way to find what the issue is, is to select the -d flag's button in the advanced tab and then re-package it. This will mean the exe is now in a debugging mode. Open up cmd and then run the exe using cmd e.g. "C:/folder/path/myexe.exe".
Any errors will be preserved in the console which you were previously missing.
from auto-py-to-exe.
What are they errors that were provided?
from auto-py-to-exe.
The only error I get is here:
When I close the exe window as it doesn't work properly, I don't even get this window when not run in debug it just doesn't start.
from auto-py-to-exe.
Please make this script console based as you will then not have to go through all the windows. Also can you please paste the command that is being executed next time?
from auto-py-to-exe.
On the CMD terminal i am executing "D:\Users\gblmac\Desktop\Python programs\Exe's\PMFinder.exe" and now that it is set to console I am at least getting my program window but when I try to use the "GO" button my itemlist doesnt show.
Here is the console window ouptut:
[15260] LOADER: sys.prefix is C:\Users\gblmac\AppData\Local\Temp_MEI11882
[15260] LOADER: Setting runtime options
[15260] LOADER: Bootloader option: pyi-windows-manifest-filename PMFinder.exe.ma
nifest
[15260] LOADER: Initializing python
[15260] LOADER: Overriding Python's sys.path
[15260] LOADER: Post-init sys.path is C:\Users\gblmac\AppData\Local\Temp_MEI118
82\base_library.zip;C:\Users\gblmac\AppData\Local\Temp_MEI11882
[15260] LOADER: Setting sys.argv
[15260] LOADER: setting sys._MEIPASS
[15260] LOADER: importing modules from CArchive
[15260] LOADER: extracted struct
[15260] LOADER: callfunction returned...
[15260] LOADER: extracted pyimod01_os_path
[15260] LOADER: callfunction returned...
[15260] LOADER: extracted pyimod02_archive
[15260] LOADER: callfunction returned...
[15260] LOADER: extracted pyimod03_importers
[15260] LOADER: callfunction returned...
[15260] LOADER: Installing PYZ archive with Python modules.
[15260] LOADER: PYZ archive: out00-PYZ.pyz
[15260] LOADER: Running pyiboot01_bootstrap.py
[15260] LOADER: Running pyi_rth__tkinter.py
[15260] LOADER: Running PMFinder.py
and I am executing the following program:
from tkinter import *
def part_search():
# The sole purpose of this function is to update elements, not creating them.
listbox.delete(0,END)
mtext = ment.get()
print(mtext)
mlabel2.config(text=mtext)
msearch = open(r"PMs.txt")
print('again')
for line in msearch:
if mtext in line:
listbox.insert(END, str(line))
listbox.config(yscrollcommand=scrollbar.set,width=0, justify=LEFT)
scrollbar.config(command=listbox.yview)
msearch.close()
return
# This code is your original code for creating the first elements
mGui = Tk()
mGui.configure(bg="orange")
ment = StringVar()
mGui.geometry ("1000x500+200+300")
mGui.title ("Parts Finder")
mlabel1 = Label(mGui, text="Type in search term:\n PM Name, Area, Markcode e.g. 11.1.1", font="Times 16", bg="orange")
mlabel1.pack()
mentry = Entry(textvariable=ment, font="Times 20", width = 50, bg="orange")
mentry.pack()
mentry.focus()
mbutton = Button(mGui, text ="Go", font="Times 30", command = part_search, bg="grey")
mbutton.pack()
# here is the moved code from the function
Finder = ()
scrollbar = Scrollbar(mGui)
scrollbar.pack(side=RIGHT, fill=Y)
listbox = Listbox(mGui)
listbox.pack(fill=BOTH, expand=1)
listbox.configure(justify=CENTER, bg="orange", font="Times 16")
mlabel2 = Label(mGui)
mlabel2.pack()
while True:
mGui.update_idletasks()
mGui.update()
Is there anything else you need?
from auto-py-to-exe.
Sorry, when saying command I meant the content of the textarea below the "Current Command" label.
When running this code when not packaged, it provides an initial error _tkinter.TclError: unknown option "-justify" and then a NameError: name 'mlabel2' is not defined when clicking the Go button.
When packaging the script myself that you provided, by simply running the exectuable in cmd I was provided with:
PS C:\Users\Brent\GitHub\auto-py-to-exe\output\a> .\a.exe
Traceback (most recent call last):
File "a.py", line 45, in <module>
File "tkinter\__init__.py", line 1330, in configure
File "tkinter\__init__.py", line 1321, in _configure
_tkinter.TclError: unknown option "-justify"
[5948] Failed to execute script a
This _tkinter.TclError as stated before is your issue.
After removing the text "justify=CENTER" from line 45 and re-packaging it now works fine.
from auto-py-to-exe.
I figured out what the issue was with it not working as expected, although I was adding an additional file "PMs.txt" it was being added to the assets directory when the program was looking in the root directory.
I changed
msearch = open(r"PMs.txt")
to
msearch = open(r"assets/PMs.txt")
and it works fine now.
thanks. :)
from auto-py-to-exe.
Oh right, you had never mentioned anything about an additional file.
Another tip is that you can change "assets/" to "." to the file can sit in the root.
from auto-py-to-exe.
Yes I saw that on the UI, but I wanted to keep the txt file separate. thanks for the help.
from auto-py-to-exe.
Related Issues (20)
- Installed auto-py-to-exe but it doesn't runs the ui HOT 5
- data include skips empty folders HOT 6
- WHERE IS THE FUK!GG EXE FILE YOU SMELLY NERDSSS!!!! HOT 9
- Child process died calling import_library() with args=('pyqtgraph.canvas',) and kwargs={} HOT 5
- Admin only GUI appearance HOT 10
- Pyinstaller Version Control HOT 2
- Pyinstaller 5.X.X is better? HOT 7
- auto-py-to-exe and configparser issue HOT 8
- Bug after trying to launch HOT 3
- Clicking the select file button will freeze on macOS 14.4 arm64 HOT 13
- Warning coloring problem HOT 3
- Unused models in the application HOT 3
- The numpy.array_api submodule is still experimental HOT 4
- just gave me a virus when compileing HOT 2
- Script requiring input HOT 17
- symbols-images into pushbutton auto-py-to-exe HOT 5
- File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\gevent\threadpool.py", line 173, in __run_task thread_result.set(func(*args, **kwargs)) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1 in position 3: invalid start byte HOT 4
- Relative Paths aren't resolved until in the temp directory HOT 5
- it loading all the requirements rather using venv requirements HOT 2
- how can we change the running command ? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto-py-to-exe.