I have just modified a script that notifies you when you have a new gmail message. Right now it just print out "you have a new gmail message" But, I would like to use some sort of graphics or something. I have zero experience with this though. Any ideas where to look or how to go about doing this?

Recommended Answers

All 5 Replies

wxPython, will aid you with GUI so will Tkinter (whic is built it). They will also allow basic graphics. For more detials graphics have a look at PyGame.

Chris

ok, ill check those out. Thanks for the help.

There is a simplifying wrapper for pygame called gasp. You need pygame installed first for this to work:

# using module gasp to draw an arc, a box, plots and circles
#
# info: GASP (Graphics API for Students of Python)
# A library built on pygame that enables absolute beginners to 
# write 1980's style arcade games as an introduction to python.
#
# free download from:
# http://dev.laptop.org/pub/gasp/releases/SOURCES/python-gasp-0.1.1.tar.bz2
# unpack python-gasp-0.1.1.tar.bz2 and copy the 'gasp' subdirectory 
# into your python path eg. C:\Python25\lib\site-packages\gasp
#
# you need pygame installed for gasp to work
# free download from : http://www.pygame.org/

from gasp import *

# rgb color tuples
black = 0, 0, 0
blue = 0, 0, 255
brown = 165, 42, 42
green = 0, 255, 0
orange = 255, 165, 0 
red = 255, 0, 0
white = 255, 255, 255
yellow = 255, 255, 0

begin_graphics()

t = Text("Huston, we have a problem!", (100,420), color=blue, size=40)

# Line(from (x, Y), to (x, y))
q1 = Line((30, 400), (500, 400), color=black)
q2 = Line((30, 395), (500, 395), color=yellow)
q3 = Line((30, 390), (500, 390), color=black)

# Arc(center (x, y), radius, degrees_start, degrees_end)
# degrees relative to x axis (horizontal)
a = Arc((100,200), 100, 30, 330, filled=True, color=red)

# Box(lower_left_corner (x, y), width, height)
b1 = Box((100, 100), 200, 200, color=blue, thickness=5)
b2 = Box((10, 50), 500, 20, filled=True, color=brown)

# Circle(center (x, y), radius)
c1 = Circle((420,200), 100, filled=True, color=green)
c2 = Circle((420,200), 120, color=orange, thickness=5)

# Plot(center (x, y)) a filled rectangle of given size
p1 = Plot((550,380), color=red, size=10)
p2 = Plot((550,60), color=blue, size=10)

sleep(5)  # display graphics for 5 seconds

end_graphics()

That looks cool. I am going to give that one a try, it's looks simple enough.

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.