
-----------------------------------
wtd
Tue Apr 05, 2005 11:43 pm

Python questions?
-----------------------------------
Anyone who has Python questions should feel free to ask them here and I'll answer them if I can.  I'll also be writing some Python tutorials here over the next few days.

Due to their similarity, these questions may be better placed in the Ruby forums, but I'll leave that judgement to those with greater authority here.  :)

-----------------------------------
Martin
Wed Apr 06, 2005 6:05 am


-----------------------------------
My housemate is learning python, I'll get him on here. Great job on the classes tutorial by the way. (well...do we even need to tell you this anymore?)

-----------------------------------
wtd
Wed Apr 06, 2005 1:02 pm


-----------------------------------
It's nice to hear.  :)

-----------------------------------
Naveg
Sun May 15, 2005 10:06 am


-----------------------------------
How do you retrieve the RGB value of a pixel using PIL?

-----------------------------------
wtd
Sun May 15, 2005 1:23 pm


-----------------------------------
http://www.pythonware.com/library/pil/handbook/imagecolor.htm

The getrgb() and getcolor() functions seem like a start.

http://www.pythonware.com/library/pil/handbook/image.htm

Also see the getpixel() method.

-----------------------------------
Lapsus Antepedis
Mon May 16, 2005 11:26 am


-----------------------------------
Semi-related question...

are there any drawing, cursor location or window commands that would function similarly to those in turing? 

I want to learn a faster and more widley available programming language, and I'm already getting the hang of the syntax in python, but if I cannot do graphics, there is no real point to me... ^.^;

most of my turing programs that deal with more than a tiny section of a picture take a VERY long time (ranging from a few hours for a photo, to a full day for a screenshot...) , and I'm an impatient person... (when it comes to things I made...)

-----------------------------------
wtd
Mon May 16, 2005 5:21 pm


-----------------------------------
No, there is no built-in library for doing this kind of thing.  That means, however, that there are many options for doing this, ranging form simple to complex.  This is the situation you'll find with most programming languages.

I suggest Googling for "Visual Python", as there is a project by that name that answers the very question you asked.

-----------------------------------
wtd
Mon May 16, 2005 7:40 pm


-----------------------------------
Also, consider learning O'Caml.  It's nice and high-level, and does have a standard graphics library.

A sample app might look something like:

include Graphics;;

open_graph " 300x300";;
rmoveto 100 100;;
draw_string "Hello!";;
print_endline "Press any key to exit...";;
read_char ();;
close_graph ();;

You'd then compile it with:

C:\> ocamlc Graphics.cma hello.ml

C:\> camlprog
