Android Python Programming [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Can I program for Android using Python? I seem to have stumbled upon many links while searching... however neither of them is concrete.
Any suggestions? I want to write apps for Android but really don't want to get into Java for all this.
PS: My question is whether I can write proper, full fledged apps for Android.

Checkout Kivy. They have done a really great job so far, and I am a big fan of their work. It is still lacking some providers, but they keep adding new stuff to it everyday. First thing you need to do is to check your requirement against what they can offer based on their documentation. They have create an amazing framework for input such as multi-touch or pen handling. They use OpenGL ES internally, as a result complex graphics and visualizations can run very fast when interacting with the the application. Their process for creating an apk is also very straight forward.

Check the new Python for Android project.
Edit: This is not Kivy, this is a seperate project, intended to be a toolchain usable for other toolkit. The architecture is modular, and you can include new recipe for including new python extensions (as brew, macports, cygwin etc.).
Edit: This is not Py4A, but python-for-android.

This is great for starters:
Embed Python 2.7 interpreter and your scripts into an Android APK

No, not currently. ASE (Android Scripting Environment) allows you to do simple script apps, but you can only write proper Android apps in Java.

Yep, you can.
Check ASE
Edit:
Ok, after comments:
I haven't read the question properly. No you can't write write proper, full fledged apps for Android, but anyway check ASE. It is really cool project.

Related

A Real Talk About Python Software Distribution [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I know this is a hot topic and many people ask this question but I have the feeling I am missing something. What is the proper way to make a python application for end-users? Like, old-school offline .exe and so on. Many users won't touch the terminal/shell and to be honest most software these days is incredibly easy to install. What I know so far:
There are packages out there that can make your software ready for redistribution like
pyinstaller, cx_freeze, py2exe
I wrote my fairly complex software in like 2 weeks and going crazy for days over making pyinstaller work with my external packages. Is this pain normal? Have I made a mistake by relying on an interpreted language? Because compiling this stuff is mean business. In many other languages you just build the stuff within the IDE and there you go, built.
I am not concerned that my code might be decompiled, so what I have tried is to just create a .bat file with commands to execute my script with my virtual environment(!) python. Can I just manage to have the Python venv in place with my scripts without the user having to install it himself?
Or what is the "usual" way to do this? Use Cython? Or pyinstaller? Praying to the lord of code?
FYI: I am using Python 3.6.8, Windows 8 (don't you dare making fun of me :D) and Pycharm 2019.2
However thank you in advance for your time, regards,
Arjaan
There is no correct or established way of how to create an executable file for your Python project. It's opinion-based.
And how you want to distribute your software is entirely up to you. It can be source code, compiled, as a docker image, through Heroku One-Click deployment, debian package, all of the above, ???.
Having choices is nice. Some people need a really simple solution then Heroku or an exe file is nice. Some people are Docker power users, then a multi-arch docker image is nice. Some people want to modify the source code than having the source code is nice. Some people like debian packages and want your project with a systemd service file automatically enabled and started.
You might also not put into the work of getting docker/debian/heroku to work and just tell them a step by step guide on how to get it to run.
Debian and Heroku route might require some periodic maintenance due to the Linux distros updating to newer versions.
There is so much to it and it is an endless discussion where noone is right or wrong.

How to create desktop applications using python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have been writing desktop application in c# and of the experience of writing my code in VS, compiling it and let .NET framework do the running and execution.
Now I want to develop desktop applications using python. I am new to python.
Speaking of UI programming, please suggest which framework is best for rich desktop app programming and why, remember I'm coming from a tool like WPF. Also Please suggest any useful tutorials to start developing desktop applications using Python.
I think that answers will be very subjective.
If you are not familiar with python, I suggest you to try few different tutorials and books. If you have experiance with C#, may be Python reference will be good for you: https://docs.python.org/2/reference/ Also, python documentation is pretty good.
After you become more or less familiar with python, than try different Python UI frameworks. Find some 5 popular fremeworks, compare their advantages and disadvantages in terms of problem you are going to solve.
Than just try few of this five. Also lots of popular python books contain chapters about python applications with GUI.
I'm now sure if StackOverflow rules are allow to suggest any specific books. Here the list for python UI frameworks (with a short description): https://wiki.python.org/moin/GuiProgramming
You can look for PyQt and Tkinter.

Python for Android [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I had a look at Kivy,but the problem is it needs a virtual machine to run apps. Isn't there a way where python codes are directly converted to java bytecode which can be run by android without any virtual machine? What are the merits/demerits in terms of performance?
May be something in jython which would help?
Try SL4A for running Python code directly on your device. It requires no compiling, conversion to bytecode or virtual machines.
More information Here
Also, you can download an IDE (I've used Eclipse, like in the tutorial you will find on the site), installed a plug-in, created my source files there and then uploaded them to my phone, if you're uncomfortable with writing code on your device.
This page has full instructions on how to package a Kivy app into an APK: http://kivy.org/docs/guide/packaging-android.html
I think some one mislead you a lot or you are confused about how things work with kivy.
I'll take this opportunity to try and make things a bit more clear.
Kivy can be used to build stand alone apk, only if you had searched kivy in google play. This link shows a list of apps that mention kivy, there are a lot more apps there that use kivy and just don't mention that. There is also a partial user maintained list you can look at. You can install the apps from google play and you'd see that they are self contained and don't require you to download anything extra.
There are very easy instructions available on how to build a apk in the link mentioned by #Marcins.
Every python code passes through the python interpreter usually pre-compiled to pyc, that's how python works even Java uses a virtual machine JVM, Android's implementation uses Dalvik VM. You can learn more about the VirtualMachines used in the languages like java/python here. The python interpreter/vm consumes the code and executes it natively, it doesn't convert it to java byte code.
if you need to make something that needs more performance then you can even use cython with kivy to get more speed.

Creating Graphical User Interface (GUI) in Python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I work mostly with Matlab but I am little bit familiar with Python as well. I have never created a GUI before, however, I have been suggested to develop a GUI for an important project in Python and not in Matlab.
Considering this situation, are there any suggestions that you would like to give which could help me create GUI in python in a time period of a month? Also, I would like to know if I can use Python's Spyder IDE and create GUI from that platform?
I suggest that you look through this list of Python GUI frameworks and choose one based on the needs you have for your application.
http://wiki.python.org/moin/GuiProgramming
Different frameworks will help you solve different UI related problems. Keep in mind the platform that your app will be used on, as some frameworks are platform specific. I personally have used WxPython and TkInter, and they are pretty good for basic interfaces. If you are looking for more advanced graphics then Kivy might be good to look at.
I would definitely vouch for wxpython. It's very good for advanced GUI work.

Graphical Front-end for Python script [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I wrote a python script here Github
It is just something I wrote to practice. The script asks for a input directory and output directory and the method of compression and then compress the files from input directory and stores the compressed archive to the output directory.
I want to make a graphical frontend for this script. I am using Ubuntu 10.10 (GNOME).
Is it possible to do so?
If yes, then where should I start?
I want to do this just for learning purposes.
Thanks
It's certainly possible. There are a ton of GUI frameworks available so you'll have more then enough choices. Given your OS is Ubuntu I would look into PyGTK first. I personally found PyGTK fit my brain pretty well and I really liked the documentation. The fact that it's the native toolkit for your Window Manager is a nice plus in that your app will hopefully look like the other Gnome apps you're already running.
Of course you could use Tkinter which is bundled with Python and cross platform. Or you could look into using PyQT or wxPython.
To be a little crazy, since this is a learning exercise, you might want to use something lower level so you might look into something like Pyglet or Pygame and spend some time learning how to build your UI widgets.
If you're looking for touch interface or iOS / Android support then checkout Kivy
Good luck.
Kivy also looks like a good alternative.
Kivy - Open source Python library for rapid development of applications
that make use of innovative user interfaces, such as multi-touch apps.
I found PyQt pretty easy to get up and running with. Check out the wiki docs here.
I find MVC a very good design pattern to use in this case, so, you might try to salvage your code (it seems very simple).
For a GUI framework, I suggest Mike Steder's response, and this list and a large list found here.

Categories

Resources