Hi, we are going to inroduce graphics in our project using python (Version 2.4), I coulsn't find the module related to graphics in this version. Is there anything you know please share that. I would be thankful if you could share the modules which suites Python 2.4 +

Recommended Answers

All 3 Replies

Any reason why you have to use such old version?

I think old Python 2.4 comes with the Tkinter GUI toolkit that has plenty of nice graphics mothods.

A Tkinter drawing example ...

''' tk_canvas_shapes101.py
use the Tkinter GUI toolkit that comes with Python
to draw some shapes
for more shapes check canvas at ...
http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/index.html
or
http://effbot.org/tkinterbook/canvas.htm
'''

# for Python3 use: import tkinter as tk
import Tkinter as tk

# create the main window
root = tk.Tk()
root.title("Drawing shapes on a Tkinter canvas")

# create the drawing canvas
canvas = tk.Canvas(root, width=600, height=500, bg='white')
canvas.pack()

rect = (50, 110, 250, 310)
# draw the outline of the rectangle
canvas.create_rectangle(rect)

# now draw the oval to fit inside the above rectangle
# an oval is drawn within a rectangle
# a square will give a circle
canvas.create_oval(rect, fill='yellow')

# start the GUI event loop
root.mainloop()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.