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 ...

# 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')

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

# 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
Be a part of the DaniWeb community

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