OpenGL 3+ with Python 3 [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I want to write a visualization for some complex scientific data in Python. I have done a similar thing a few years ago in Objective-C/Cocoa/OpenGL. The visualization will contain some fancy shader programs, so at least OpenGL 3.0 is required. Also, I need to draw a window and do some mouse/keyboard handling. Some GUI widgets would be nice, but not required. Python 3 support is highly desirable.
I looked into:
PyOpenGL, which has no window/mouse/keyboard handling.
PyGlet, which only supports Python 2.7.
PyQt, which only supports OpenGL 2.0.
PySide, which is pretty much dead, and stuck in Qt 4.7.
wxPython, which only supports Python 2.7.
PyGame, which is pretty much dead.
Do you know any library that can do modern OpenGL and some windowing in Python 3?

My recommendation is PyOpenGL plus PyQt. Python plus either Pyglet or wxPython are possible alternatives.
PyOpenGL (the Mike Fletcher version, right?) is the best Python OpenGL API I know of. It has support for OpenGL 3 and 4 and is just very nice and Pythonic.
PyQt itself only supports OpenGL 2, but PyOpenGL will run inside a PyQt context. Since PyQt does have a Python 3 version, this combination should meet your needs.
For the GUI stuff I prefer wxPython, but as you note that hasn't been updated for Python 3 yet. You could take a look at the wxPython Phoenix project, but that's very much a work in progress.
Pyglet is also quite nice but has less GUI functionality that wxPython or PyQt. Think of it as the equivalent of GLUT. The Python 3 version is currently in alpha, but given that it's not a complete rewrite I'd expect it to be stable very soon.
Hope this helps.

Related

simple graphics package in python 2 or 3 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
The following website from the official python tutorial seems to imply that a graphics package is automatically included with an install of Python 3. Beyond being highly skeptical of that, my python 2 does not have the package in question.
http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/graphics.html
Does anyone have any ideas or substitutions for performing simple windowed graphics in python, 2 or 3?
The default python "graphics" package is Tkinter
https://wiki.python.org/moin/TkInter
In Python 3, it's called "tkinter" - in python 2 it's called "Tkinter". It sometimes includes (depending on your distribution) ttk or tix, which are extensions. It makes direct calls to Tcl, so it's pretty fast at basic operations.
PIL/Pillow is a very standard dependency for any kind of image manipulation. Tkinter basically will only let you work with gif and postscript files
https://pypi.python.org/pypi/Pillow
Zelle graphics a beginners graphics program built on tkinter. It is not a serious graphics suite (it's super duper slow), though it can be extremely good for educational purposes. It's meant to accompany his Python book or for self-teaching. Try Turtle as an alternative for teaching purposes, there are a lt of tutorials out there. I don't know which distributions include it, but you can easily download it by googling for it
From your linked page:
You will just be a user of the graphics.py code, so you do not need to
understand the inner workings! It uses all sorts of features of Python
that are way beyond these tutorials.
Those features are called Tkinter. I like tk, and this it's pretty easy to use, but that's subjective - take a look and decide for yourself.
If you're looking for more advanced suites or any kind of 3D (tkinter is strictly 2D) (my guess is you aren't for now, but that's okay), try OpenGl for python, or pygame.

Graphics on Linux without full-blown window manager? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Is it possible to do graphics on Linux without installing and using a full blown window manager like Gnome/KDE etc?
I am working on an embedded system with a touch screen and I just need to generate Python plots and perhaps have a few buttons to select which plots are displayed. There is no mouse or keyboard.
I do not want to use a windowing system because that would be total overkill for this project. Is there any way I can just display my plots and buttons in fixed locations on the screen and be done with it? Platform is Debian Linux.
Yes, there are libs available. Years ago I used svgalib. Games like Quake used it as well.
http://www.svgalib.org
I may be behind the times, however, so I am not sure how current this alternative is. It seems a bit out of date.
You can program w/ Xlib directly. There looks to be a python port; I've included a link to a manual for the native C library since the python docs look skimpy and that may help with some of the concepts.
In your question you've perhaps conflated the concept of window manager with windowing system. GNOME and KDE are actually desktop environments built on top of a window manager. The latter are generally much lighter weight than the former and can often be used standalone (openbox, fvwm, et. al.).
These are in turn built on top of the windowing system, which is Xorg. It is possible to do graphical stuff without that using the kernel framebuffer, which apparently is an option for pygame.
Another alternative would be to not even have X at all. You could try using SDL w/ framebuffer support - a thread regarding this approach can be found here: Using OpenGL Without X-Window System

Python 3.X or Python 2.X [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
What's the ideal Python version for a beginner to start learning Python? I need to recommend some newbies a programming language to learn and I chose Python. I'm still not sure which version.
It depends what you're going to do with it.
Unicode handling has vastly improved in Python 3. So if you intend to use this for building web pages or some such, Python 3 might be the obvious choice.
On the other hand, many libraries and frameworks still only support Python 2. For example, the numerical processing library numpy, and the web framework Django both only work on Python 2. So if you intend to use any of those, stick with Python 2.
Either way, the differences aren't huge to begin with. I'd say Python 3 is a little easier to pick up (due to its string handling), but that is a good reason to learn Python 2 first. That way, if you run into a piece of Python 2 code (and you will), you'll know what is going on.
Adoption of Python3 has been held up by a few critical 3rd party packages. numpy is a good example of a package that has just barely started working on Python3. Quite a few other packages depend on numpy, so they will hopefully be supporting Python3 very shortly too.
Most of the time it's possible to write code that is compatible with 2.6/2.7/3.1 by using __future__ imports. So learning one does not mean you are not learning the other.
My vote is for 3.1
My reasoning is simple and selfish. The more new python programmers that only use 3.1 there are, the more likely it is that one of them is going to decide that they need some library from 2.6 and port it to 3.1 (learning 2.6 in the process I might add).
After this happens, I can start using 3.1: it looks really cool.
I would suggest Python 2.6; I know it's old, but it's not only the current standard, and there is way more documentation and libraries available for it.
I'll throw my experience into the works:
Right now you should be using 2.6. Switch to 2.7 when 2.7.1 comes out. Switch to 3.1/2 when all the libraries you want are fully supported and stable there.

Python: Attractive, clean, packagable windows GUI library [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I need to create a simple windows based GUI for a desktop application that will be downloaded by end users. The application is written in python and will be packaged as an installer or executable.
The functionality I need is simple - selecting from various lists, showing progress bars, etc. No animations, sprites, or other taxing/exotic things.
Seems there are quite a few options for Python GUI libraries (Tk, QT, wxPython, Gtk, etc). What do you recommend that:
Is easy to learn and maintain
Can be cleanly packaged using py2exe or something similar
Looks nice
[Update] For what it's worth I ended up going with tkinter. It's fairly well documented, can be made to look nice (mainly, use native fonts), and most importantly ships with Python so there's nothing extra to worry about. wxpython also looked good, but the download was 10M or so, and I didn't want to add that extra weight to the packages I distribute.
tkinter's major advantage (IMHO!) is that it comes with Python (at least on Windows). It looks ugly, and there's no progress bar or something like that (at least not builtin). Being a thin wrapper around Tk, its API doesn't feel very elegant or intuitive. However, there are quite a few good Tkinter resources on the web so learning it is not necessarily a pain.
For any serious GUI attempts, I'd go for wxPython as well. I don't know about packaging, though. But I wouldn't expect any problems.
I've recommended wxPython in the past and it's still an excellent tool. The others always seemed somewhat cumbersome to me.
There's instructions out there on the web which show exactly how to package a wxPython GUI.
The wxAui section in particular can give some really clean / usable results:
The most beautiful one that I can suggest is PyQt (almost native), otherwise a good idea would be using directly IronPython that is native .net code.
Anyway nothing beats tkinter for multi-platformness and packaging-friendliness.
I've used wxPython in the past (For Mac/Windows deployments). It has worked good. And it looks nicer than Tk :)
From using both wxPython and TKinter, I'd say wxPython looks nicer and is easy to learn.
Although you said you are planning on using the program for Windows, it's worth mentioning that I've had problems with TKinter on Mac not working correctly.

Is Tkinter worth learning? [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 7 years ago.
Improve this question
I generally make my desktop interfaces with Qt, but some recent TK screenshots convince me Tk isn't just ugly motif any more.
Additionally Tkinter comes bundled with Python, which makes distribution easier.
So is it worth learning or should I stick with Qt?
(source: kb-creative.net)
The answer to your question is a resounding yes.
Qt is good, I have nothing against it. But Tk is better and far easier to use and quite well documented - not just on the Python webspace, but there are also many third-party tutorials out there. This particular one is where I learned it from and it has been quite infallible in serving me.
As a step up to other GUI toolkits, sure. If you know other toolkits then you already understand TkInter and can leave it until you actually need it.
You might want to take a look at this(wxPython).
wxPython is the best and most mature cross-platform GUI toolkit, given a number of constraints. The only reason wxPython isn't the standard Python GUI toolkit is that Tkinter was there first.
-- Guido van Rossum
Why not go for PyQT? You apparently are already familiar with Qt, so it should be relatively easy to learn. In my opinion it looks better than Tkinter, and it sure is better documented.
I used Qt with C++, but decided to have a go with Tkinter with Python. I had a bit of trouble installing the latest version of Tcl/Tk, but got there eventually. I did it all with the help of this tkdocs.com tutorial, which is great.

Categories