Graphics (drawing by points) in Python
I started studying python in order to write one small application for the output of graphical data, I searched for different materials on the language and was faced with a lack of literature on working with graphics in this language, but I know that it is implemented. Please tell me the literature on configuring and displaying graphical data.
For now, I need to write the application I'm interested in in a fairly short time, and then I will understand more deeply about the language.
The task is as follows: to display a window with text and two buttons, to display graphic data (i.e. drawing a drawing by points) when one button is clicked, and to display text data when the other button is clicked. And a button to return to the original window. That's it.
I would like to solve it with python tools.
5 answers
Find the library graphics.py it contains primitives based on TK, which is already in the language
If we do it quite simply, then I would choose PyQt4. 3 lines of code - the rest can be done on styleSheet as in html...
#!/usr/bin/python
# -*- coding: cp1251 -*-
from PyQt4 import QtCore,QtGui
app = QtGui.QApplication([])
label = QtGui.QLabel("img src='1.png'")
#если знать размер картинки
label.resize(100,100)
label.show()
app.exec_()
Matplotlib - standard selection. And in addition, graphs and charts:
You can take something that seems simpler, and look at the examples in the documentation.
The list Python GUI. PyQt, for example, I'm sure it will allow something else. From this list, probably EasyGui is the easiest option. But I don't know if she can draw graphs. However, you can do a "feint with your ears": draw a picture and shove it into a standard window.
UPD And matplotlib, by the way, allows navigation buttons to place, and tex is not a problem to draw