How to deploy a pyGtk application - python

I have developed a Gtk3 application using Python 3.9.7. All development was done on Ubuntu 21.10.
My question is: what is the modern way of deploying such an application to a Windows platform?
I spent the last couple of hours looking for a solution. I have tried pyinstaller, py2exe and cx_freeze, but all methods of this conversion I could find appear to be outdated and nothing seems to work. I can't even get them properly installed on Windows, which seems to be a necessity.
So if someone has recently done any deployment like that, I'd greatly appreciate a walk-through of how I could do it. Cross-platform (meaning without doing the actual build on Windows) would be great.
I'd prefer to not rewrite the whole project, since it's quite big and that would take a lot of time.

Related

Packaging Kivy application to Android - Windows

I finished writing the code for a simple game using Kivy. I am having a problem converting it to Android APK, since I am using a windows computer. From some earlier research I got to know that using a Virtual machine is recommended, but I have no idea on how to download and use one :(, and if my slow PC can handle it... please help me. If possible, kindly recommend another way to convert to APK.
I am a beginner at coding as a whole, please excuse me if my question is stupid.
you could just try downloading a virtual box and installing linux operating system or you could directly install it and keep it a drive called F or E and you could just install python on that and all the required pakages and start the build using buildozer as it is not available for windows. So try doing it. But I need to do it just now. Tell me after you have tried that cuz there are a lot of people online on youtube who would heloo you doing that work

Is there a skeleton project for a graphical cross-platform Python application?

I found that making a Python application work across all three platforms with, say, PySide is hard enough work as it is. Surely there's a project that provides an example codebase where this all works (even packaging the application and deploying it as well)
You could use PyInstaller. The development version works with OSX and the older versions work with all linux distributions i have tried (ubuntu/debian, opensuse,...)
Just have a look at it, works fine for me www.pyinstaller.org

Handle multiple version at the same time?

I am currently developing an application based on Opencv (more info here).
In order to ensure that everything is working fine, I would like to try the same code with multiple versions of OpenCV (2.3, 2.4).
This is mainly aiming for Linux development, but I wouldn't mind finding a solution for Windows also.
As a bonus, I'd really be glad If I could also switch between version from packages, and other compiled from sources.
The solution I am currently thinking about is to download and compile several versions (without the make install) and then use the chosen release folder manually for imports.
This doesn't solve the package intstall issue, and may not be really usable in the long run
What yould be the best way to achieve such an objective ?
Virtualenv seems to be the good solution for this :
virtualenv is a tool to create isolated Python environments.
...
Imagine you have an application that needs version 1 of LibFoo, but
another application requires version 2. How can you use both these
applications?

Portable Python (Mac -> Windows)

I have a lovely Macbook now, and I'm enjoying coding on the move. I'm also enjoying coding in Python. However, I'd like to distribute the end result to friends using Windows, as an executable.
I know that Py2Exe does this, but I don't know how portable Python is across operating systems. Can anyone offer any advice? I'm using PyGame too.
Many thanks
The Python scripts are reasonably portable, as long as the interpreter and relevant libraries are installed. Generated .exe and .app files are not.
Py2exe generates Windows executables, so they will only work on the Windows Platform. The FAQ at http://www.py2exe.org/index.cgi/FAQ has more information on how it all works. Essentially it provides what is needed to run on Win9x as well as more current platforms. NOTE: the FAQ mentions some potential gotchas with character encodings and the work arounds.
With python, it is common enough on Unix based systems, as several Linux distributions have their custom maintenance scripts written in the language. So the Python scripts will be just as portable as Ruby scripts, etc. As long as the target machine has the interpreter and you are not using external programs that are only on one type of platform, others will be able to use your work.
Personally I experienced huge difficult with all the Exe builder, py2exe , cx_freeze etc. Bugs and errors all the time , keep displaying an issue with atexit module.
I find just by including the python distro way more convinient. There is one more advantage beside ease of use.
Each time you build an EXE for a python app, what you essential do is include the core of the python installation but only with the modules your app is using. But even in that case your app may increase from a mere few Kbs that the a python module is to more than 15 mbs because of the inclusion of python installation.
Of course installing the whole python will take more space but each time you send your python apps they will be only few kbs long. Plus you want have to go to the hussle of bundling the exe each time you change even a coma to your python app. Or I think you do , I dont know if just replacing the py module can help you avoid this.
In any case installing python and pygame is as easy as installing any other application in windows. In linux via synaptic is also extremly easy.
MACOS is abit tricky though. MACOS already come with python pre installed, Snow leopard has 2.6.1 python installed. However if you app is using a python later than that and include the install of python with your app, you will have to instruct the user to set via "GET INFO -> open with" the python launcher app which is responsible for launcing python apps to use your version of python and not the onboard default 2.6.1 version, Its not difficult and it only takes a few seconds, even a clueless user can do this.
Python is extremely portable, python pygame apps cannot only run unchanged to the three major platform , Windows , MACOS ,Linux . They can even run on mobile and portable devices as well. If you need to build app that runs across platform , python is dead easy and highly recomended.
If you are planning to include Linux in your portability criteria, it's worth remembering that many distributions still package 2.6 (or even 2.5), and will probably be a version behind in the 3.x series as well (I'm assuming your using 2.x given the PyGame requirement though).
Versions of PyGame seem to vary quite heavily between distros as well.

is mac good for python programming?

I am programming a django based website. I actually use a small computer under Ubuntu 10.04.
I would like to buy something more professional, so I am wondering whether an iMac is good for that, because :
Is there a free IDE as good as eclipse on MacOS ?
Is there a remote python debugger like pydev for eclipse ?
Is there some typical issues with python on MacOS ?
does apache+mod_wsgi works well on MacOS ?
Why do you consider iMac to be more or less professional than anything else? Hardware? System?
Note: I'm myself a MacOSX and Linux user.
Unless it's a requisite, most times I'd say it's only a matter of personal taste.
As said by others earlier, everything you cited works fine on MacOSX.
However, you should consider the 3rd party libraries you're going to use with Python.
I would cite a problem I had with MySQLdb (MySQL-python) on MacOSX, but it has been solved. You might face other problems in the way, but nothing that could stop you from using Django, Eclipse, etc.
All of the things you mentioned (Eclipse+plugins, Python, Apache, mod_wsgi) can run fine on OS X.
My answers based on several years spent developing with Python on OsX:
Eclipse is multiplatform, you can have it on OsX too.
I would not call pydev a python debugger, anyway you have it on Eclipse for Osx
You would have probably the same issues you had under Ubuntu (OsX is Unix based)
Yes it works without problem
One thing I always recommend is to install macports;
with macports installing Eclipse, different Python versions, apache, mod_wsgi is really easy.
FWIW, mod_wsgi is developed on MacOS X. My experience in supporting users of mod_wsgi is however that MacPorts and fink are an absolute PITA. Specifically, trying to use Python and Apache from those third party systems usually causes nothing but hurt. This is based on problems encountered over the last couple of years. I haven't heard much lately though, so it may be the case that those systems have finally fixed up their 32/64 bit issues and Python build problems.

Categories