very early beta cross platform thelemic date software
-
93,
Thought you might appreciate a sneak peak. You need a working internet connection, Python 2.5 and PIL (Python Image Libraries) installed to compile and run this code. All three of these are available in windows, mac, linux, etc. GPL v3, no responsibility for errors blah blah blah. =] enjoy.
**# Still to fix - Error will be thrown if urllib2 can't fetch images. Need error
handling.
Stuff for window managament, image management, internet capabilities, etc
from Tkinter import *
import Image, ImageTk, urllib2, cStringIOGrabs the first image from the internet, can be twitchy so workaround is
to save and reopen the file for now.
file = urllib2.urlopen("http://www.artcharts.com/images/legend.gif")
im = cStringIO.StringIO(file.read())
img = Image.open(im)
img.save("thelemic_date.png")
image = Image.open("thelemic_date.png")Adds a label to a window, the image is displayed within the label.
root = Tk()
photo = ImageTk.PhotoImage(image)
label = Label(image=photo)
label.image = image
label.pack()It's all done again for the second image required...
file = urllib2.urlopen("http://www.lashtal.com/thelemic_date/date.php")
im = cStringIO.StringIO(file.read())
img = Image.open(im)
img.save("thelemic_date.png")
image = Image.open("thelemic_date.png")And a second label is added to the window
root = Tk()
photo2 = ImageTk.PhotoImage(image)
label2 = Label(image=photo2)
label2.image = image
label2.pack()The window is displayed, the program ends when the window is closed.
root.mainloop()
**Feedback please =]
93
-
Do what thou wilt shall be the whole of the Law.
-
cool, i love python