Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Python questions?
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wtd




PostPosted: Tue Apr 05, 2005 11:43 pm   Post subject: 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. Smile
Sponsor
Sponsor
Sponsor
sponsor
Martin




PostPosted: Wed Apr 06, 2005 6:05 am   Post subject: (No subject)

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




PostPosted: Wed Apr 06, 2005 1:02 pm   Post subject: (No subject)

It's nice to hear. Smile
Naveg




PostPosted: Sun May 15, 2005 10:06 am   Post subject: (No subject)

How do you retrieve the RGB value of a pixel using PIL?
wtd




PostPosted: Sun May 15, 2005 1:23 pm   Post subject: (No subject)

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




PostPosted: Mon May 16, 2005 11:26 am   Post subject: (No subject)

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




PostPosted: Mon May 16, 2005 5:21 pm   Post subject: (No subject)

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




PostPosted: Mon May 16, 2005 7:40 pm   Post subject: (No subject)

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:

code:
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:

code:
C:\> ocamlc Graphics.cma hello.ml

C:\> camlprog
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: