I am just a newbie on that things and I want to turn python to apk with android studio or whatever. I don't really need anything to complex, I just want to open my codes output gui (I used turtle) when I open the app. Nothing else, thats all. It is probably complex process so you can just give me where to look and learn if you can't explain it all in here. Thanks!
Turtle is built around TKinter, which is a library for making desktop apps. There doesn't seem to be a way to run programs built in TKinter within Android without using some other app to run them. If you're ok with that, then you could use the solution suggested by this answer to run your code by pasting it into an app that can run Python code.
Related
I have written a small program in python and QT5. I want it on raspberry PI as a single application. I have checked out buildroot and yocto but can't seems to find a single tutorial which can explain the steps from compiling the python code and make it part of buildroot/yocto. Can anyone please guide me or point me to a tutorial.
Regards,
In Buildroot, there are two ways that you can add your own Python code to the build.
Using a root filesystem overlay to add you python files in the appropriate place in the root filesystem. This has a lot of limitations though: it doesn't get byte-compiled, you have to make sure yourself that it gets installed in some location in PYTHONPATH, and generally it's a bit more difficult to maintain. However, it's a very simple approach for a first try.
Creating a custom python package. It's also not really complicated to do that, but you really do have to read the documentation.
I tried to open a file, the filename is 1.txt. I tried to open it with webbrowser.open("1.txt") or os.startfile("1.txt") which worked perfectly fine, but I couldn't find any information about how to start programs or anything with Python in full screen. I'm using Linux and Python 3.6.
Any ideas how to perform something like that?
There are more answers to that question than there are GUI toolkits, and there are plenty of toolkits.
I think the first thing you need to do is decide on a GUI toolkit. Research it depending on your necessities (python version, OS support, etc). Once you settle on one, find out how to make a fullscreen app with that. If you can't, ask again.
Good luck.
I wrote a py .exe script and need to create a GUI for it with a file path input field, a 'cancel' and 'ok' buttons. How can I accomplish it best? Do I need to bind it with any C libraries? I know I could easily create a web based interface but I do not want a web app, I need a .exe app.
Please, help!
For such a simple GUI, Python comes with a built in library: TkInter. It's somewhat ugly, but it might be fine for your purposes - requires nothing 3rd party, so no additional installations. If you want something more full featured, I'd suggest PyQt
wxPython is the best thing I can think of.
Have a look at easydialogs for window http://www.averdevelopment.com/python/EasyDialogs.html
I googled and search stackoverflow before asking this question
Answers that I don't expect:
wxWidgets is the best Python GUIUse TkInter (BIM) for GUI development.
Q. How to make a GUI without using any module/library? i.e make a GUI from scratch. Modules like tkinter not allowed.
I've made several GUIs from scratch using SDL which is a low level drawing library. The advantage of doing that is that it will look exactly the same on any platform down to the pixel and you can get it to work on embedded systems. Full screen GUIs are really easy too. Disadvantages are that it is a lot of work.
In python the pygame library wraps SDL so you would use that, and in fact that is how I made the GUI for a lab instrument which had a large colour LCD screen. The controller ran linux, but not X-windows.
pygame is an extra library, yes, but I can't think of a way of making a GUI with only what python provides.
The easiest GUI to make without "module/library" is a web-based one. I.e. generate HTML with Javascript from your Python code, and let the Javascript interact via AJAX with your Python app. This can be implemented without too much effort with just the standard Python library (and some JS code, of course), or with modules that don't require "heavy" installation of platform-specific extensions.
I want to enable use of PyQT gestures in my application. Anybody has an example or some short code that could demonstrate use of gesture control in PyQT application?
I tried googling around but could find only one post about customizing the gesture... I am not that far yet at all, I just want to see how to bind the gesture and callback in Python QT app.
thanks
I'm working the same problem. No reason why it shouldn't work, by simply translating some of the C++ examples, but its bleeding edge.
For example, won't work on Linux desktop (just Windows) without Qt 5 or a lot of work. See http://qt-project.org/forums/viewthread/12664. If I get Qt 5 installed, I hope to post a Python example.
I am using PySide, and the QtGraphicsFramework and have a small test program. Another more sophisticated test, of custom gestures, is crashing, not just throwing exceptions, and I'm suspecting the Python binding.
There are plenty of nuances. If any platform is good for learning, it should be Qt and Python. Go figure why there are no examples yet.