[Tutor] Jimage reader. How to find the pixels?

Joseph Quigley cpu.crazy at gmail.com
Sun Jun 12 13:58:26 CEST 2005


I have finally made my very first GUI program!! It needs some work 
before I would ever consider putting it on sourceforge (ha ha ha). I 
have a problem though. I can't find an image lib that will detect the 
picture's height and width automatically. I can use wave to detect mono 
or stereo but that's another story. Oh, one more thing, how can I make 
it so that I can type: python jimagereader.py /home/joe/pic.jpeg  
instead of the prompt within the program: Image name:

Here's my code:

from livewires import games

image_nm = raw_input("Image name: ")
SCREEN_WIDTH = int(raw_input("Image height: "))
SCREEN_HEIGHT = int(raw_input("Image width: "))

the_screen = games.Screen(SCREEN_WIDTH, SCREEN_HEIGHT)
bckgrnd_image = games.load_image(image_nm, transparent = False)
the_screen.set_background(bckgrnd_image)
the_screen.mainloop()

Thanks.
Joe

-- 
Unix Love, Linux Pride

-----BEGIN GEEK CODE BLOCK-----

Version 3.12

GU d- s-:- a---- C++++ UL++++ P L++ !E W+ N+ !o !K w !O !M V- PS-- !PE Y+ PGP- t- !5 !X !R !tv b+++ DI+ !D G e- h! !r y? k F

------END GEEK CODE BLOCK------




More information about the Tutor mailing list