Is Python good for graphics?

Discussion in 'Python' started by Esmail Bonakdarian, Dec 15, 2004.

  1. 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/Year2/PLDS210/sorting.html#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/SlidingBlockPuzzles/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 I’d 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
    Esmail Bonakdarian, Dec 15, 2004
    #1
    1. Advertising

  2. 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/Year2/PLDS210/sorting.html#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/SlidingBlockPuzzles/quzzle.htm).


    how about:

    http://vpython.org/

    </F>
    Fredrik Lundh, Dec 15, 2004
    #2
    1. Advertising

  3. 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
    Esmail Bonakdarian, Dec 16, 2004
    #3
  4. Esmail Bonakdarian

    Robert Kern Guest

    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/enthought/branches/converge/kiva/

    --
    Robert Kern


    "In the fields of hell where the grass grows high
    Are the graves of dreams allowed to die."
    -- Richard Harter
    Robert Kern, Dec 16, 2004
    #4
  5. Esmail Bonakdarian

    Doug Holton Guest

    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/Year2/PLDS210/sorting.html#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/SlidingBlockPuzzles/quzzle.htm).
    >
    > Note, the ability to do this via the web would be nice, but definitely
    > is *not* required at the moment.


    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/

    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
    Doug Holton, Dec 16, 2004
    #5
  6. Esmail Bonakdarian 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?


    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).

    </F>
    Fredrik Lundh, Dec 16, 2004
    #6
  7. 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/enthought/branches/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
    Esmail Bonakdarian, Dec 17, 2004
    #7
  8. 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
    Esmail Bonakdarian, Dec 17, 2004
    #8
  9. 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
    Esmail Bonakdarian, Dec 17, 2004
    #9
  10. Esmail Bonakdarian

    djw Guest

    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/Year2/PLDS210/sorting.html#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/SlidingBlockPuzzles/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 I’d 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/
    djw, Dec 17, 2004
    #10
  11. Esmail Bonakdarian

    John Hunter Guest

    >>>>> "djw" == djw <> 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
    John Hunter, Dec 17, 2004
    #11
  12. 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.
    not [quite] more i squared, Dec 17, 2004
    #12
  13. Esmail Bonakdarian

    Guest

    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/Year2/PLDS210/sorting.html#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.
    , Jan 3, 2005
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob
    Replies:
    26
    Views:
    901
  2. sikka noel
    Replies:
    8
    Views:
    417
    Mike Wahler
    Aug 5, 2003
  3. vlsidesign
    Replies:
    26
    Views:
    973
    Keith Thompson
    Jan 2, 2007
  4. Cliff  Martin
    Replies:
    1
    Views:
    3,033
    Larry Smith
    Jan 31, 2007
  5. Lee Harr
    Replies:
    1
    Views:
    179
Loading...

Share This Page