py2app | Unofficial mirror of SVN repo http
kandi X-RAY | py2app Summary
kandi X-RAY | py2app Summary
py2app is a Python setuptools command which will allow you to make standalone Mac OS X application bundles and plugins from Python scripts. py2app is similar in purpose and design to py2exe for Windows.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Check if file is newer than the given time
- Return a list of leases
- Yield leases from lines
- Menu Save event handler
- Menu SaveAs event handler
- Saves the work to file
- Timeout event handler
- Draws lines to dc
- Initialize buffer
- Check wxglade
- Import data files
- Read from file
- Read text from a UTF - 8 file
- Called when an application ends
- Prints an exception handler
- Open file dialog
- Read file
- Get data files from a list of paths
- List of leases
- Create an app bundle
- Disable linecache
- Create a new plugin
- Setup pkg resources
- Add site - packages
- Sets the lines data
py2app Key Features
py2app Examples and Code Snippets
Community Discussions
Trending Discussions on py2app
QUESTION
So I have made this simple Password Manager in Python 3.8 using PyQt5, and I have been using the 'py2app' module to create a standalone application of this program. However, when I execute my app (both from the terminal and the finder), I get a simple popup saying "keysafe Error". My code is executing just fine and has no errors. I can't seem to figure out the problem here. If it helps, I get this message in my macOS logs:
...ANSWER
Answered 2021-May-20 at 22:21So I finally was able to find an answer to this question!
The first thing to do is open your setup.py
file, the default one should look like so:
QUESTION
I have created a python script that helps automate a part of my work on Mac Os VMs. In addition to that it makes use of some other files (some jsons and a few files that need to be copied on the Macos machine in a specific location). Since the script contains also a ui part(via pyqt) I need to pack all files into one app, but I ran into an issue I need the resulting app to ask for Administrative rights when it is ran. I search the internet and the py2app documentation and can't find any info on how to achieve this
any workaround or py2app is not what I need?
...ANSWER
Answered 2021-May-10 at 14:15ended up using "elevate" library. worked like a charm :)
QUESTION
I'm sorry if this is very obvious but I am trying to convert a .py to a .dmg This is the tutorial I followed: https://www.youtube.com/watch?v=IIAlkQEw8Gc
I ran python setup.py py2app
. I did everything that was in the video: I installed py2app, I created a setup.py in the same directory as my .py file with the piece of code that was in the video.
I really don't know what to do, can you help me? (total noob action here!)
ANSWER
Answered 2021-May-04 at 16:05I see I think you need to download the file to get on with coding
QUESTION
I am trying to build a standalone app that utilises Pandas. This is my setup.py file:
...ANSWER
Answered 2021-Apr-15 at 06:30I think I have found a solution: downgrade to Python version 3.6.6. See: python 3.6 module 'cmath' is not found
To uninstall Python I followed this process: https://www.macupdate.com/app/mac/5880/python/uninstall Then I installed Python 3.6.6: https://www.python.org/downloads/release/python-366/
With Python 3.6.6, Py2App seem to work no problem and includes Pandas smoothly.
It seems that for some reasons cmath
is not included in the latest versions of Python? I might be wrong. Please let me know what you think and if you have any questions.
P.S.: I am using MacOS (Mojave 10.14.6) and PyCharm.
QUESTION
I have a function test()
as shown below, downloading a txt-file containing emoji's and other unicode special characters. The downloaded content is saved to a .txt file and then, per line, with line numbers added, to a .csv file.
When I build test.app (using py2app) and run it, it does save the .txt file (showing the same content as the original) but when saving .csv, it stops at the first special character (with error message test Error: Open console / Terminate; system.log shows 'Service exited with abnormal code: 255').
On the other hand, when running test.app/Contents/MacOS/test, it works properly and saves the whole content to .csv without any problems.
I have tested it with a pure Python version as well as cythonized, and also code-signed. In all cases, .app doesn't work while .app/Contents/MacOS/test works properly.
I would like to know why is it different (I've only started with Mac 3 months ago and definitely don't know everything about it) and what should I change to get my test.app working properly.
...ANSWER
Answered 2021-Apr-03 at 22:15app runs with a different locale from the one when you run directly on the command line.
Try to put in your .py :
QUESTION
- vyper Version (output of
vyper --version
): 0.2.8+commit.069936f - OS: osx
- Python Version (output of
python --version
): Python 2.7.16 - Environment (output of
pip freeze
):
ANSWER
Answered 2021-Mar-11 at 07:07Look at the description of range-function, there just one way to pass a variable to it:
QUESTION
I have a Python project where the main file has spaces in the name. I understand that this is not encouraged, but in this case, I think it's necessary. The file is being compiled into a stand alone executable using py2app--which uses the file name for the application name when building the executable (app name, menu references, etc.). This works fine because the base file is not imported anywhere within the project and py2app handles the spaces gracefully. Let's call the file Application Name.py
.
In order to run unit tests against Application Name.py
, however, I have to eliminate the spaces in order to import the file into unittest
. I'm unable to use importlib
or __import__
because the file is not constructed as a package, so both approaches fail. My workflow has been to refactor the file name to application_name.py
, run the unit tests, and then refactor the name to Application Name.py
before compiling it into Application Name.app
.
So the options appear to be:
- Keep doing what I'm doing (workable, but not ideal),
- Create a wrapper called
Application Name.py
that importsapplication_name.py
where the wrapper doesn't need to be unit tested (seems silly), - Convert
Application Name
into a package so I can useimportlib
(seems like overkill), or - Something else entirely.
Is there some way to gracefully handle file names with spaces in unit testing that I'm not seeing or should I just suck it up?
...ANSWER
Answered 2021-Feb-26 at 02:07Seems like option 2 probably works best.
Option 1 and 2 are your best bets (yes 3 is a bit overkill), and although 2 seems excessive, it does isolate your python logic from your py2app requirements - now Application Name.py
is a "py2app wrapper file", and application_name.py
contains your actual logic.
This works better than Option 1 because separation of responsibilities is generally preferred. If you come up with other requirements for your application name, you'd want to have to deal with just the "py2app wrapper file", and not change anything related to actual logic.
Your current workflow works too, but it does mean more manual renaming when you want to run unit tests - what if you want to automate the unit testing process?
QUESTION
I have tried to do this with py2app but my app opens and then closes immediately. The modules in my code are:
...ANSWER
Answered 2021-Jan-25 at 23:52I fixed the problem. One of my modules was not being imported so it was swapped out. I also moved over to pyinstaller.
QUESTION
So I am trying to turn my code: https://github.com/TheLostProgrammer/Video_Downloader/blob/main/Video_Downloader.py Into an .app file using py2app so I can use it on my mac...
Every time I go to open the .app file it opens and then immediately closes.
Here is the contents of my setup.py:
...ANSWER
Answered 2021-Jan-18 at 16:26Okay... So after adding Try: and Except: to my code to find where the error was I found out it was one of my modules... Also, I moved from py2app over to pyinstaller as it is an easier process.
QUESTION
So I'm trying to use Py2app to export a python script that uses tkinter and writes to excel, and I'm getting this error;
...ANSWER
Answered 2020-Oct-21 at 12:30Turns out I was looking in the wrong place, the error was with _imaging.so. I hadn't taken this on board because I didn't recognise the .so file as a dynamic library. Using otool -L _imaging.so
showed the dependancies that were missing and bingo, they included libopenjp2.2.3.1.dylib
amongst others. I ended up just copying the contents of myapp/contents/frameworks
to usr/local/lib
which seems to work fine, although this doesn't seem like a robust solution.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install py2app
You can use py2app like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page