Please i really need help.
I have this problem which i have been unable to solve.
I wrote some python gui script of which i want to create a win32 app from for portabilty(i.e not compel all my app user to download/install python) and to make my application close sourced.
I have decided to use/ tried using pyinstaller and py2exe but have always had this problem. My gui application shows up with a console window accompanining it.
I have tried several thing to prevent this but all were in vain. I tried changing the extension from .py to .pyw and repackaging but got same result.
Please i need help on how to avoid/override this. Thanks for you help in advance
Note: I use python 2.7.11 on a window 7 32bit system.
And please dont mark my question as duplicate in reference to questions like : Run Python script without Windows console appearing or How to hide console window in python? as my question is completely different.
Thanks for your help in advance.
I was able to get it working with pyinstaller by using the --no-console argument i.e by adding -w. Here is the syntax of my code.
pyinstaller -F -w my_script.py
where -F is to creates one file for standalone app i.e --onefile and -w is to disable console window i.e --no-console.
Thanks.
Related
Hello so I'm kind of new with programming and I buildt a program with python and kivy. The issue is that I am using auto-py-to-exe to convert the py files to exe but when I do it, it doesn't work well. The primary issue is that a windows command prompt opens when I run the app and if I close it, the app closes too. The other problem is that I can't share the file to someone else so that they can run it in another computer, and what happens is that the same command prompt kind of appears but then closes and the app doesn't open at all. I would appreciate it if someone could help me to understand how I can debug it as I don't even understand the problem in the first place.
I have been looking online for other people with the same issues but I haven't find any answer that applied to my case.
Try to choose Window Based(hide the console) and it wil works
If you choose “Console Based,” the console will open after running the executable file, which is recommended if your script generates console-based outputs. However, if you don’t want to show the console outputs when running the executable file, choose “Window Based”
I created a little application with Python3 and gtk glade, I'm using the terminal to see if I'm doing something wrong. However I want to launch the application without the terminal in the back at the end of the developement. So my question is, is there a way to do that?
You can change the file extension from .py to .pyw to make the Python script run without the terminal window. More on this here.
I am using Atom on Windows 10. While setting up Atom on my computer, I created a folder called "beyond basics". Then I created a python file. I installed platform io on Atom. i got a "+" icon on screen. upon clicking that i got a command line. I am trying to execute on that by writing python filename but I am getting an error. Any help is appreciated.
python3 myfile.py
Try typing myfile.py without the python prefix. It may work, as it works for me on Windows 10. Your bubble is covering up an error message that could help use debug. Can you add an edit and tell us the error message? Until then, just try the command without the python prefix.
You should also save before running, as was commented by Denis Fetinin.
If it still doesn't work, try addding python to the env variables. It's a simple process that you can follow here.
I'm attempting to turn a short Python program that I wrote into an easily-distributable application file for OS X, using py2app. I made it through the py2app tutorial, but when I click on my application file the following dialogue is shown:
A Python runtime not could be located. You may need to install a
framework build of Python, or edit the PyRuntimeLocations array in
this application's Info.plist file.
I'm not sure whether this is helpful, but clicking "Open Console" from that dialogue shows the following errors:
LaunchServices: Could not store lsd-identifiers file at /private/var/db/lsd/com.apple.lsdschemes.plist
launchservicesd[83]: SecTaskLoadEntitlements failed error=22
appleeventsd[53]: SecTaskLoadEntitlements failed error=22 11/27/16 7:29:19.787 PM
sharedfilelistd[307]: SecTaskLoadEntitlements failed error=22
I know that if py2app uses a "system" version of Python to produce an app, it won't include that Python in the distribution. However, entering $ which python in the terminal directs me to my anaconda installation, so that doesn't seem to be the issue.
This is my first time attempting to create a piece of software, so apologies in advance for any obvious missteps. Any help would be greatly appreciated, as I've been banging my head on this all day.
I am new to python programming and development. After much self study through online tutorials I have been able to make a GUI with wxpython. This GUI interacts with a access database in my computer to load list of teams and employees into the comboboxes.
Now my first question is while converting the whole program into a windows exe file can I also include the .accdb file with it...as in I only need to send the exe file to the users and not the database..if yes how.
My second question is... I actually tried converting the program into exe using the py2exe (excluding the database...am not sure how to do that) and I got the .exe file of my program into the "Dist" folder. But when I double click it to run it a black screen (cmd) appears for less than a second and disappears. Please help me understand the above issue and resolve it.
am not sure if I have a option of attaching files...then I could have attached my wxpython program for reference.
Thanks in advance.
Regards,
Premanshu
The console could possibly appear if you used the 'console' parameter to setup(). Switch to 'windows' instead if that is the case. Can't say for sure without seeing your setup.py script. Possibly your app could also be opening console, but again hard to say without seeing source. One thing to check is to make sure you are not printing anything to stdout or stderr. You might want to redirect all of stdout and stderr to your log just in case, and do this right at the top of your start script so that if some 3rd party import was writing to stdout you'd be able to capture that.
The db is not part of your executable, so py2exe will not do anything with it. However, you should probably package your application with an installer, and you can make the installer include the db and install it along with the executable.