PySimpleGUI / PySimpleGUI/PySimpleGUI
[Bug] Hard-coded Windows paths in (some) Qt demos
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 13.8k
- Forks
- 1.8k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Type of Issues (Enhancement, Error, Bug, Question)
Bug
Operating System
Linux (KDE Neon 5.18)
(although I imagine any non-Windows OS could have issues)
Python version
Python 3.6.9
PySimpleGUI Port and Version
PySimpleGUIQt 0.31.0
0.31.0. Released 24-Dec-2019 <module 'PySimpleGUIQt' from '/home/jaapie/.local/lib/python3.6/site-packages/PySimpleGUIQt/__init__.py'>
Your Experience Levels In Months or Years
~2 years, but very casually _________ Python programming experience
~6 or 7 years, fairly casually (hobby, taken a few C++ and Web Design courses) _________ Programming experience overall
No sir_________ Have used another Python GUI Framework (tkiner, Qt, etc) previously (yes/no is fine)?
You have completed these steps:
- Read instructions on how to file an Issue
- Searched through main docs http://www.PySimpleGUI.org for your problem
- Searched through the readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
- Looked for Demo Programs that are similar to your goal http://www.PySimpleGUI.com
- Note that there are also Demo Programs under each port on GitHub
- Run your program outside of your debugger (from a command line)
- Searched through Issues (open and closed) to see if already reported
Code or partial code causing the problem
Edit: I originally posted that the error occured when trying to run Demo_Tree_Element.py rather than Qt_Demo_Table_Element.py
I'm not sure if this even counts as a bug, so I apologize if I'm wasting somebody's time. I cloned the PySimpleGUI repo in order to have access to all the demo files, and when attempting to run Qt_Demo_Table_Element.py I got the following error:
$ ./Qt_Demo_Table_Element.py
Traceback (most recent call last):
File "./Qt_Demo_Table_Element.py", line 18, in <module>
with open(filename, "r") as infile:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Python\\PycharmProjects\\GooeyGUI\\ProgrammingClassExamples\\Win10 versions\\AFL2018 (sorted pts and %).csv'
I was a little confused as to why a Windows-style path was showing up in the error, but when I looked at the code I noticed that the full path is hard-coded into the demo code. I hunted around the rest of the cloned repo and found the appropriate folder and file pretty quickly, and after changing the code to the proper path the demo worked perfectly fine.
I also noticed similar paths in Demo_Tree_Element.py that point to some PNGs; the demo seems to work (no errors) but I'm wondering if there may be some icons or other graphics that aren't being displayed.

It's a pretty simple and straightforward fix and I doubt most people would have trouble figuring it out on their own, but I could understand someone who is very new to either Linux or python having some frustration over it.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit Qt_Demo_Table_Element.py und Demo_Tree_Element.py und konzentriere dich auf die im Bericht erwähnten fest codierten Windows-Pfade. Führe die Demos auf einem Nicht-Windows-System aus und überprüfe die referenzierten CSV- und PNG-Ressourcen. Als erledigt gilt die Aufgabe, wenn die Demos ihre Ressourcen korrekt finden und die erwarteten Grafiken anzeigen, ohne maschinenspezifische Pfade zu benötigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- desktop
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100