Skip to content

College of Thelema: Thelemic Education

College of Thelema and Temple of Thelema

  • A∴A∴
  • College of Thelema
  • Temple of Thelema
  • Publications
  • Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse

very early beta cross platform thelemic date software

Scheduled Pinned Locked Moved Tools & Toys
3 Posts 3 Posters 461 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    foreverfaithless
    wrote on last edited by
    #1

    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, cStringIO

    Grabs 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

    Q V 2 Replies Last reply
    0
  • Q Offline
    Q Offline
    Quintessence
    replied to foreverfaithless on last edited by
    #2

    Do what thou wilt shall be the whole of the Law.

    1 Reply Last reply
    0
  • V Offline
    V Offline
    vanlangjahr
    replied to foreverfaithless on last edited by
    #3

    cool, i love python

    1 Reply Last reply
    0

  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups