Py3.2 indicates that this the installer for Python 3.2, there are installers for other versions of Python too.
You can copy, click on (Toggle Plain Text) first, and paste the typical PyQT code below and run it from an IDE like IDLE that comes with your Python installation ...
# use PyQT to draw a simple vertical bar chart
# tested with PyQT4.8 and Python3.2
from PyQt4.QtCore import *
from PyQt4.QtGui import *
def __init__(self, data, parent=None):
# create the window (will be instance self)
# setGeometry(x_pos, y_pos, width, height)
self.setGeometry(300, 300, 360, 320)
self.setWindowTitle('Simple Bar Chart')
self.data = data
def paintEvent(self, event):
painter = QPainter()
# set color and width of line drawing pen
# drawLine(x1, y1, x2, y2) from point (x1,y1) to (x2,y2)
# draw the baseline
painter.drawLine(20, 280, 340, 280)
# set up color and width of the bars
width = 20
delta = width + 5
x = 30
for y in self.data:
# correct for width
y1 = 280 - width/2
y2 = y1 - y + width/2
# draw each bar
painter.drawLine(x, y1, x, y2)
# add values to the top of each bar
s = str(y)
painter.drawText(x-8, y2-15, s)
x += delta
# data to be graphed
data = [30, 45, 80, 150, 220, 180, 110, 75, 50, 35, 20, 10]
app = QApplication()
bc = BarChart(data)
It is alternative for PyQT which has no limitations for commercial use (LGPL), I sent one announcement resently to Python forum, when I realised it came out. PyQT has two licence models GPL, which is free for non-commercial use, and other by payment for commercial development. LGPL: Pyside bindings for QT released!
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...