Re: Simple but fast 2D lib for drawing pixels

2006-10-03 Thread Peter Ilgenschütz
Thanks Dave for this tip, this is excellent, exactly what I have been
looking for!
I'm using it already :-)

Kind Regards,
Peter

[EMAIL PROTECTED] wrote:
>
> On Oct 1, 2006, at 6:28 PM, Peter Mexbacher wrote:
>
>> Hello,
>>
>> we want to teach absolute programming newbies
>> a first language, so they can start programming
>> simple scientific models.
>>
>> We thought Python would make a good choice for
>> a first language; but where pretty stumped when
>> we found out that there is no simple way to draw
>> pixels to a screen. (This is needed for fractals,
>> agent-based models etc -> like Conways Game of Life)
>>
>> Our requirements:
>>
>> -) easy to learn (newbs!)
>> -) not too slow (after all, the models should simulate something)
>> -) python :-)
>>
>> Any ideas?
>>
>> Best Regards,
>> Peter
>
>
> You might check out John Zelle's Python book - he uses a simple
> graphics library on top of Tk (which Python comes with). You can find
> information on his book and the graphics.py file he uses at:
>
> http://mcsp.wartburg.edu/zelle/python/
>
> It certainly meets your easy to learn and Python requirements - and of
> course speed is subjective so it may or may not be fast enough for you.
>
> Dave
>
>
>
>
>

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Simple but fast 2D lib for drawing pixels

2006-10-01 Thread davbrow

Peter Mexbacher wrote:
> Hello,
>
> we want to teach absolute programming newbies
> a first language, so they can start programming
> simple scientific models.
>
> We thought Python would make a good choice for
> a first language; but where pretty stumped when
> we found out that there is no simple way to draw
> pixels to a screen. (This is needed for fractals,
> agent-based models etc -> like Conways Game of Life)
>
> Our requirements:
>
> -) easy to learn (newbs!)
> -) not too slow (after all, the models should simulate something)
> -) python :-)
>
> Any ideas?
>
> Best Regards,
> Peter

Did you look at the turtle module included in the standard
distribution?  It's very simple, made for beginners, and fast enough
for simple plots (just turn off the tracer).  If you intend to
introduce the class to GUI's at some point I believe turtle is built on
the Tkinter canvas widget, which may be suitable as well.

However, if you're teaching scientific programming to more technically
advanced users you might be better off using matplotlib/ipython.  That
will get you a matlab-like enviroment with many advanced capabilities.

-- David

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Simple but fast 2D lib for drawing pixels

2006-10-01 Thread Richard Jones
Peter Mexbacher wrote:
> We thought Python would make a good choice for
> a first language; but where pretty stumped when
> we found out that there is no simple way to draw
> pixels to a screen. (This is needed for fractals,
> agent-based models etc -> like Conways Game of Life)
> [snip]
> -) easy to learn (newbs!)
> -) not too slow (after all, the models should simulate something)
> -) python :-)

http://www.pygame.org/ - it's not just for games :)

It'll do what you want (put pixels on the screen) easily. It'll even let you
work with numeric arrays and then put those arrays on screen. Sign up to
the pygame users list to ask more questions - they're always a helpful,
friendly bunch.


Richard

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Simple but fast 2D lib for drawing pixels

2006-10-01 Thread davelist

On Oct 1, 2006, at 6:28 PM, Peter Mexbacher wrote:

> Hello,
>
> we want to teach absolute programming newbies
> a first language, so they can start programming
> simple scientific models.
>
> We thought Python would make a good choice for
> a first language; but where pretty stumped when
> we found out that there is no simple way to draw
> pixels to a screen. (This is needed for fractals,
> agent-based models etc -> like Conways Game of Life)
>
> Our requirements:
>
> -) easy to learn (newbs!)
> -) not too slow (after all, the models should simulate something)
> -) python :-)
>
> Any ideas?
>
> Best Regards,
> Peter


You might check out John Zelle's Python book - he uses a simple  
graphics library on top of Tk (which Python comes with). You can find  
information on his book and the graphics.py file he uses at:

http://mcsp.wartburg.edu/zelle/python/

It certainly meets your easy to learn and Python requirements - and  
of course speed is subjective so it may or may not be fast enough for  
you.

Dave



-- 
http://mail.python.org/mailman/listinfo/python-list


Simple but fast 2D lib for drawing pixels

2006-10-01 Thread Peter Mexbacher
Hello,

we want to teach absolute programming newbies
a first language, so they can start programming
simple scientific models.

We thought Python would make a good choice for
a first language; but where pretty stumped when
we found out that there is no simple way to draw
pixels to a screen. (This is needed for fractals,
agent-based models etc -> like Conways Game of Life)

Our requirements:

-) easy to learn (newbs!)
-) not too slow (after all, the models should simulate something)
-) python :-)

Any ideas?

Best Regards,
Peter
-- 
http://mail.python.org/mailman/listinfo/python-list