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
Related
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.
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.
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 6 years ago.
Improve this question
I have very simple task to accomplish in python. Need to draw textual data (Unicode) as rows on the screen, navigatable and user can select/deselect row. However, this should work on headless Linux, as well as Windows or Mac OS. Curses doesn't have Windows port. Console module from Fredrik Lundh works only on Windows. I could use both libraries and check OS, but then it takes double effort to make/maintain the same functionality on 2 different libraries.
I'm looking for simple multiplatform console library to draw what I've described.
At a lower level you will have to use curses and there are several choices for the underlying curses library on Windows which may or may not work. You won't have any real problems with curses on UNIX so if I were you, I would get it working on Windows first and if a particular feature doesn't work their, program around it. The UNIX port should be painless.
PDCurses for Windows is available as a DLL or source code and it is possible to interface directly to any DLL using the ctypes module. There is a tool which can automatically generate a ctypes wrapper for you called ctypesgen.py http://wavetossed.blogspot.com/2011/07/asynchronous-gnu-readline.html I'm not sure if that works for a Windows DLL quite so automatically, but it does work from header files so it is worth a try.
For more background on ctypes, have a look at some of the questions here like Scheduling function calls in a Python curses UI
I recently had a similar issue for a package I was putting together (https://github.com/peterbrittain/asciimatics). I wasn't very happy with the solutions that required you to install (or worse) build separate binary executables like PDCurses or cygwin, so I created a unified API that provides console colours, cursor positioning and keyboard input for Windows and UNIX platforms.
There is a gallery of sample applications here. In more recent releases, I have also added a set of widget objects to allow you to create TUIs like this:
This is now live and has been tested on CentOS 6/7 and Windows 7/8. You can install it from PYPI using pip and then use the Screen class to do exactly what you want. If not, please post an enhancement request on GitHub and I'll see what I can do.
I use urwid. It's documentation is poor, but on the other hand, its source base is very compact. It supports Unicode well and works fine on Cygwin. Doesn't seem work in native CMD.exe, but it's worth closer investigating seeing how the curses dependency is only optional.
Examples from the project site:
(source: urwid.org)
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 am a pretty recent developer..
but I have a single monitor (big enough) but it is so annoying that every now and then I first use the text editor to write the code and then go to terminal to execute and debug
I was wondering if there is any developer tools where I can like use half screen for that note pad and the other half for terminal.. so that I dont have to shuffle back and forth between the terminal and the text-editor...
Something like, when this software is running... then notepad and terminal just freezes in that half screen and when i close this software I can minimize and turn to normal mode.
If not it would be cool thing to have. :D
THanks
Use ViM in split window mode, edit your script on the left side and start ConqueTerm (use :ConqueTerm bash) on the right side. Now you can code and execute Python code in the same terminal window at the same time using a superior text editor ;-)
Disclaimer: Of course this only helps if you are familiar with ViM already.
If you're developing in Python - have a look at PyCharm. It's a clone of IntelliJ IDEA, tailored for python development, written in Java, so work on any platform. If you like it, it also doesn't cost a whole truckload.
That's for the easy and money-based way. More complex ways - you can use a text editor that allows running your scripts, upload to webservers, whatnot. It pretty much depends on the stuff you're developing.
You might want to check out Sublime Text.
When you say "terminal" do you mean a python console or a real system terminal?
If it is the first case, then most if not all python IDE I have ever used do have that functionality built in: gedit, eclipse, geany, SPE, just to mention a few.
If it is the second case, some IDE like gedit do have a plugin for that, but in general what you should probably use is another window manager (namely a tiling window manager). No idea on how the situation looks like on Microsoft / Apple OS's, but under GNU/Linux you have a plethora of different tiled window managers. Two that I tried and liked are Xmonad and Awesome.
HTH!
There are many editors... and IDE's that will allow you to run your code from directly within the editor / IDE enviroment
Perhaps I'm misunderstanding the question, but it seems like the easiest way is to simply manually resize the windows and place them where you want them. Also, a handy tool in general is the Python IDLE, where you can code in the Python window and simply have it run in the shell by pressing F5.
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.