Comments (4)
My workaround is ugly, I call this function in my main:
def check_windows_exe(app_name):
import platform
if platform.system() == "Windows":
to_file = os.path.join(__file__, app_name)
from_file = to_file + ".exe"
if os.path.exists(from_file) and not os.path.exists(to_file):
import shutil
shutil.copyfile(from_file, to_file)
from gooey.
Same error here: did you fixed it somehow? Ty.
from gooey.
I have the same problem and found a workaround.
Since the problem occurs only on Windows when called from the command line shortcut (commandName
or commandName.exe
); and not from the python file (python path/to/commandName.py
works fine), I call the actual python script when I am in this case.
At the beginning of commandName.py:
import sys, platform, subprocess
if platform.system() == 'Windows' and not sys.argv[0].endswith('.py'):
subprocess.call([sys.executable, __file__])
sys.exit()
# [...] rest of the script
sys.argv[0]
is the name of the calling command, it should end with .py
otherwise the command python __file__
is run. __file__
is the current file path (of commandName.py
) and sys.executable
is the python executable.
In my case I only open the gui when there are no arguments (when len(sys.argv) == 1
) so I do not need to pass them to the subprocess, but it should be possible with subprocess.call([sys.executable, __file__] + sys.argv[1:])
.
from gooey.
This workaround might not work for a PyInstaller or cs_Freeze app, since sys.executable
will not point to a python interpreter.
Well actually I just test it, I don't have the problem with PyInstaller (and probably neither cs_Freeze) since it does not make use of the console script!
from gooey.
Related Issues (20)
- Question: Can a script decorated with gooey be invoked without gooey? HOT 1
- Gooey outputs characters after completion "[0m" HOT 3
- `increment` field in `Slider` widget not working HOT 3
- Problem with "colored" library for richtext-control HOT 4
- Is there a way to retain global state upon "Edit" (i.e going back to the first screen and running script again)
- DecimalField: "Field is required" message despite entering a number HOT 4
- Python 3.12 release on pypi (and preferrably also on conda-forge)
- Tabbed output tab title is not rendered properly on tabs other than first
- ModuleNotFoundError: No module named 'rewx' HOT 1
- Mutually exclusive option groups behave strangely when given default values
- args cases
- Gooey freezing and not showing simple print statements HOT 1
- Click CLI support HOT 2
- Gooey Crashes - Segmentation Fault on MacOS when exiting HOT 2
- the second MultiFileChooser get only one file HOT 1
- Project abandoned by originator? HOT 3
- I am very pleased to recommend a library for adding pop ups
- How could i make checkbox default true but user can dont change to False HOT 1
- GUI window recurses when defining more than one GUI in a module
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 gooey.