By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,935 Members | 1,387 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,935 IT Pros & Developers. It's quick & easy.

Is Python good for graphics?

P: n/a
First of all, I *really* like Python ;-)

I need some help with the graphical side of things. I would like to do
some basic graphics with Python, but I am not sure what the best/most
effective way for me to do what I want.

Basically, I would like to be able to create some basic animations
where I can help visualize various sorting algorithms (for instance
http://ciips.ee.uwa.edu.au/~morris/Y...ml#insert_anim)
or graph searches (coloring nodes as each gets visited). (Something
like this: http://cs.smith.edu/~thiebaut/java/graph/Welcome.html)

Or to create and manipulate programmatically a simple 2-D block puzzle
(like this: http://www.johnrausch.com/SlidingBlo...es/quzzle.htm).

Note, the ability to do this via the web would be nice, but definitely
is *not* required at the moment.

These would be used to help in learning/teaching.

I am aware of Tkinter and wxPython (by aware I mean I know of their
existence :-) Before investing (a lot?) of time to learn these, I
thought Id ask the more experienced folks around here what would be
the best way to invest my time to get basic graphics going.

I really am not concerned so much with efficiency as easy of use.

Can anyone recommend what would suit my rather limited needs best?
Are there other graphics libraries I should consider that would be
more suitable?

Or is Python not the way to go for this?

Thanks!

Esmail
Jul 18 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Esmail Bonakdarian wrote:
Basically, I would like to be able to create some basic animations
where I can help visualize various sorting algorithms (for instance
http://ciips.ee.uwa.edu.au/~morris/Y...ml#insert_anim)
or graph searches (coloring nodes as each gets visited). (Something
like this: http://cs.smith.edu/~thiebaut/java/graph/Welcome.html)

Or to create and manipulate programmatically a simple 2-D block puzzle
(like this: http://www.johnrausch.com/SlidingBlo...es/quzzle.htm).


how about:

http://vpython.org/

</F>

Jul 18 '05 #2

P: n/a
Fredrik Lundh wrote:
how about:

http://vpython.org/


hi,

thanks, I didn't know about that.

do you (or anyone else) have a recommendation for 2D type
graphics?

Thanks,
Esmail
Jul 18 '05 #3

P: n/a
Esmail Bonakdarian wrote:
Fredrik Lundh wrote:
how about:

http://vpython.org/

hi,

thanks, I didn't know about that.

do you (or anyone else) have a recommendation for 2D type
graphics?


I like Kiva (but then, I also help develop it). The best place to get it
right now is the SVN repository, but it's fairly stable.

http://svn.enthought.com/svn/enthoug...converge/kiva/

--
Robert Kern
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
Jul 18 '05 #4

P: n/a
Robert Kern wrote:
do you (or anyone else) have a recommendation for 2D type
graphics?

I like Kiva (but then, I also help develop it). The best place to get it
right now is the SVN repository, but it's fairly stable.

http://svn.enthought.com/svn/enthoug...converge/kiva/


thanks Robert, I'll check it out.

I'm really only looking for something very simple with minimal
learning curve so that I can concentrate on algorithms and not
have to worry too much about visualualizing things.

Esmail
Jul 18 '05 #5

P: n/a
Fredrik Lundh wrote:
WCK, Tk's Canvas, wxPython (do they have a canvas-style widget
available these days), any other self-respecting UI toolkit...

but if you're going to do animations, the drawing part isn't really the hard
bit -- and vpython is designed to do animations. if you want things to look
pure 2D, all you have to do is to position the lights and the camera correctly...

(does vpython support orthographic views out of the box? if it doesn't,
that shouldn't be hard to add).


Thanks again, I'll consider it (I need to find out about WCK, never
heard of that before either).

Esmail
Jul 18 '05 #6

P: n/a
Doug Holton wrote:

I'll tell you know it's not going to be so easy. There isn't something
in python like flash. But here are some options:

See pyxel for python: http://bellsouthpwp.net/p/r/prochak/pyxel.html
and pygame: http://pygame.org/
Gato, the graph animation toolkit, is implemented in python and tkinter:
http://www.zpr.uni-koeln.de/~gato/
cool, thanks for the links, I'll take a look.
You know you can use java with python, too. It's called jython. You
could use jython to interface the open source physics toolkit, for
example: http://www.opensourcephysics.org/
See also the Jython Environment for Students (JES). A book about it is
supposed to be published tomorrow actually.

And you can use a python-like language for .NET called boo with the
Piccolo.NET structured graphics toolkit: http://www.cs.umd.edu/hcil/jazz/
or these graph drawing toolkits: http://netron.sourceforge.net/ewiki/
http://www.codeproject.com/cs/miscctrl/quickgraph.asp


hmm .. more options. I guess my preference would be to stick just with
Python if possible.

regards,
Esmail
Jul 18 '05 #7

P: n/a
djw
Esmail Bonakdarian wrote:
First of all, I *really* like Python ;-)

I need some help with the graphical side of things. I would like to do
some basic graphics with Python, but I am not sure what the best/most
effective way for me to do what I want.

Basically, I would like to be able to create some basic animations
where I can help visualize various sorting algorithms (for instance
http://ciips.ee.uwa.edu.au/~morris/Y...ml#insert_anim)
or graph searches (coloring nodes as each gets visited). (Something
like this: http://cs.smith.edu/~thiebaut/java/graph/Welcome.html)

Or to create and manipulate programmatically a simple 2-D block puzzle
(like this: http://www.johnrausch.com/SlidingBlo...es/quzzle.htm).

Note, the ability to do this via the web would be nice, but definitely
is *not* required at the moment.

These would be used to help in learning/teaching.

I am aware of Tkinter and wxPython (by aware I mean I know of their
existence :-) Before investing (a lot?) of time to learn these, I
thought Id ask the more experienced folks around here what would be
the best way to invest my time to get basic graphics going.

I really am not concerned so much with efficiency as easy of use.

Can anyone recommend what would suit my rather limited needs best?
Are there other graphics libraries I should consider that would be
more suitable?

Or is Python not the way to go for this?

Thanks!

Esmail


PyGame?

http://www.pygame.org/

Jul 18 '05 #8

P: n/a
>>>>> "djw" == djw <dw******@comcast.net> writes:

djw> PyGame?

djw> http://www.pygame.org/

Seconded, despite the plethora of packages proposed in response to the
original query, pygame seems like a clear winner for the problem
described.

And this coming from the author a different graphics package!

JDH

Jul 18 '05 #9

P: n/a
Esmail Bonakdarian wrote:
do you (or anyone else) have a recommendation for 2D type
graphics?


A possible approach is jython that gives you access to Java2D. Makes it easy
to deploy your animated or interactive graphics as a java-compatible applet.

Jul 18 '05 #10

P: n/a

Esmail Bonakdarian wrote:

Basically, I would like to be able to create some basic animations
where I can help visualize various sorting algorithms (for instance
http://ciips.ee.uwa.edu.au/~morris/Y...ml#insert_anim) or graph searches (coloring nodes as each gets visited). (Something
like this: http://cs.smith.edu/~thiebaut/java/graph/Welcome.html)


For the sorting algorithms, at least, check out
Demo/tkinter/guido/sortvisu.py in the standard distribution.
I'd recommend Tk for all the other demos you described, too.

Jul 18 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.