Re: [pygame] pygame for portable python

2009-04-10 Thread René Dudfield
Yeah cool.

I think it will give me a good push to finish off more tests as we change
towards py3k.

The sprite module is missing tests for a lot of the older sprite
functionality.  So that's the major one of the .py files I think.  Our build
scripts, and tests are the other major .py files.

If we start back porting some of the pgreloaded py3k stuff, then I think we
can have a pygame 1.9 prerelease for py3k within 4 weeks time(in time for
the course).  Remember, it only took Marcus a few days to port pgreloaded.


cheers,



On Fri, Apr 10, 2009 at 11:32 AM, Lenard Lindstrom  wrote:

> I would agree that Python 2.6 is more appropriate at the moment. Jython,
> for instance, is still at 2.5 beta. And many games depend on pyopengl at the
> minimum. As for releasing a Python 3.0 version of Pygame, that could be a
> problem if two versions of the .py modules must be kept. Since one goal for
> Pygame 1.9 is to have extensive unit tests ready, and therefore completing a
> major bug hunt in Pygame, it would be best to wait until after that is done.
> But yes, we can start readying Pygame for Python 3 by backporting
> pgreloaded's cross-compatibility tools.
>
> Lenard
>
> René Dudfield wrote:
>
>> Hi,
>>
>> python 3.0 is *not* so good to teach.  Most of the available tutorials,
>> and books use 2.x.  Most of the available code uses 2.x
>>
>> Major modules like numpy, pyopengl, and 5000+ other modules are not ready
>> for python3 yet.
>>
>> It's just not ready yet (even the python developers say that).
>>
>>
>> However, when are you teaching it?  We might be able to get a python3
>> release of pygame ready in time.
>>
>>
>> cheers,
>>
>>
>>
>>
>> On Fri, Apr 10, 2009 at 6:58 AM, Andre Krause > p...@andre-krause.net>> wrote:
>>
>>dear list, i need pygame for
>>
>>www.portablepython.com 
>>
>>
>>i need it for teaching programming to total beginners. i choose
>>python 3.0.1
>>version of portable python, because it avoids some problems that
>>would confuse
>>programming beginners ( for example the integer division problem)
>>
>>later in the course i introduce pygame and let them program a very
>>simple
>>breakout like game and a baloon pop game.
>>
>>question: is pygame already compatible with python 3.0.1 ?
>>
>>
>>i tried installing the binary release:
>>
>>"pygame-1.8.1.win32-py2.6.msi ~  1.4M (python2.5.4 is the best
>>python on windows
>>at the moment)"
>>
>>would it help if i would try a svn - nightly build version ?
>>
>>
>>currently, i get the error message:
>>
>>
>>"Traceback (most recent call last):
>> File "", line 248, in run_nodebug
>> File "C:\Dokumente und Einstellungen\herc\Eigene
>>Dateien\module1.py", line 2,
>>in 
>>   from pygame import *
>> File
>>"c:\PortablePython3\App\lib\site-packages\pygame\__init__.py", line 70
>>   raise NotImplementedError, MissingPygameModule
>>^
>>SyntaxError: invalid syntax"
>>
>>
>>kind regards and thanks in advance !
>>
>>
>>
>
> --
> Lenard Lindstrom
> 
>
>


Re: [pygame] PyConsole IN Pygame?

2009-04-10 Thread René Dudfield
Hi,

there are some consoles around... search on the pygame website.

An ipython based one would be awesome.  Note, that pygame has clipboard
support since 1.8, so would be good for selecting/copying text and such.
Also copying in image data from an editor(gimp) and pasting it into the
console - assigning it to replace in game graphics from the clipboard!

Would be great if we had a nice working implementation.


cheers,



On Fri, Apr 10, 2009 at 8:03 PM, Campbell Barton wrote:

> Hi, have been writing basic console in blender3d's game engine but I
> was thinking that anyone else trying to write an in-game console (like
> in quake :) ) would have to do almost the same things.
> There is just some differences when you are getting events directly,
> and having to do a basic readline style line editor in python which
> could be generic between blender3d or any other engine.
>
> Requirements are that you can get events, render text and store the
> console object between execution's.
>
> I was wondering if anyone had written a python console in PyGame? or
> could it be useful to port as a testcase?
>
> --
> - Campbell
>


Re: [pygame] Networking library

2009-04-10 Thread Patrick Mullen
Python2.6 comes with json.  Other than that, it is a small thing to include.

The library seems to be built around json, so removing it as a
dependency doesn't make much sense.

I took a look at this library when you announced it and thought it
looks good, but I haven't had a chance to really try it out.

The whiteboard example is very impressive!  It looks a lot easier to
start working with than twisted.


Re: [pygame] Networking library

2009-04-10 Thread Michael Fiano
I agree, preferably the former :)

On Fri, Apr 10, 2009 at 6:07 PM, Ian Mallett  wrote:

> I'm sure it might be a pain, but removing the dependency on simplejson
> would be really great.  Either, that, or include it in the distr.
> -Ian
>


Re: [pygame] Networking library

2009-04-10 Thread Ian Mallett
I'm sure it might be a pain, but removing the dependency on simplejson would
be really great.  Either, that, or include it in the distr.
-Ian


Re: [pygame] GSOC: Extending Camera support for PyGame to Mac OSX Updates!

2009-04-10 Thread Nirav Patel
A kalman filter is I think implementable in numpy without much
difficulty, and numpy is already a dependency.

It depends on what you are looking for, but searching Google Scholar
on a specific topic is a great way to learn about various algorithms.

Nirav

On Fri, Apr 10, 2009 at 5:07 AM, el lauwer  wrote:
> Hoi,
>
> Those mask functions sound useful. Do you think it would be a good idea to
> implement a kalman filter in pygame that can be used for color based object
> tracking.
>
> Is there a good place I can find computer vision related information.
>
> Grtz
>
>
> On 9-apr-09, at 18:08, Nirav Patel wrote:
>
>> Excellent.  Making your code available as you work on it is a great
>> idea, especially for something like this that needs to be tested on a
>> wide range of hardware.
>>
>> About pattern recognition, something like face recognition is probably
>> too heavy for pygame purposes and would be better suited for pyehci or
>> opencv-python.  However, extending some of the basic computer vision
>> stuff would certainly be useful, like higher or even arbitrary moments
>> [0] in masks, thresholding with hysteresis, hole detection in masks, a
>> mask to surface function, etc.
>>
>> Nirav
>>
>> [0] http://en.wikipedia.org/wiki/Moment_(mathematics)
>>
>> On Thu, Apr 9, 2009 at 11:44 AM, el lauwer  wrote:
>>>
>>> Hoi,
>>>
>>> I recently posted my proposal for GSOC to socghop. There where some
>>> comments
>>> about the content, so I have updated my proposal, and hereby posted it to
>>> this mailing list so guys can comment further on my proposal...
>>>
>>>
>>> Rene Dudfield maid the following remark about my original proposal:
>>>
>>> "
>>> Also a section on user testing would be good.  Where you ask others to
>>> download pygame to run your tests - to make sure it works ok with their
>>> computer/camera.
>>>
>>> Finally a change in your proposal to seek feedback from the community on
>>> what changes you will do after the osx stuff is finished would be good.
>>>  Since I have a feeling that you should have some time left over at the
>>> end.
>>> "
>>> I am planning to make a branch of my code available on github.com so
>>> everybody who like can follow my daily work on the project.
>>> Later on in the project I intend to make some blog post about my work and
>>> post them on reddit.com/r/python, reddit.com/r/mac,
>>> pygame ML and other communities so people can test my code. I have 2 mac
>>> at
>>> home and know some other people with macs who
>>> would be willing to test out my work.
>>>
>>> Pattern recognition is a complicated subject, But I think that it would
>>> be a
>>> good thing if there where some basic pattern recognition
>>> included like a steering wheel or a face. This would allow any gygame
>>> programmer to use this feartues in there game without any
>>> additional work. A possible interesting project to experiment with could
>>> be http://code.google.com/p/ehci/wiki/pyehci
>>>
>>> If you have any suggestions, remarks or questions please comment.
>>>
>>> original
>>> proposal:
>>> http://socghop.appspot.com/student_proposal/show/google/gsoc2009/abe/t123872941171
>>> updated
>>> proposal: http://socghop.appspot.com/document/show/user/abe/gsoc_updates
>>>
>>>
>>> =
>>>
>>> Updated proposal:
>>>
>>> Instructions
>>>
>>> Start by getting in contact with the mentor(s) familiar with your
>>> proposed
>>> project.  They will help you polish your proposal and introduce you to
>>> the
>>> developer team you'd be working with over the Summer.
>>>
>>>
>>>
>>> Summary:
>>>
>>> Nirav Patel has recently implemented camera support into pygame as a way
>>> to
>>> interact with a game. However, this camera module is limited to the Linux
>>> platform. The goal of my project is to extend this camera module to the
>>> Mac
>>> OSX platform, and thus extending the portability of games written in
>>> pygame
>>> that use a webcam as mean to interact with the player.
>>>
>>> I will be using the OSX QiuckTime multimedia framework to work with the
>>> camera. The camera module shall be implemented in C as a python
>>> extension.
>>> It is my intension to fully port the capabilities of the existing camera
>>> module. If there are any existing capabilities in the QT Isight
>>> framework,
>>> that could be useful to have in the pygame module, I will make these
>>> available by writhing a wrapper around them.
>>>
>>> I will use pyobjc to experiment during the project. For the final code I
>>> will use objc and C wrappers,since pyobjc is no longer used in
>>> pygane.
>>>
>>> When I am finished implementing the camera module for OSX, I will work on
>>> optimizing the existing code, like optimizing the sbggr8_to_rgb function.
>>> Ather this I will write documentation and a simple game to demonstrate
>>> the
>>> capabilities.
>>>
>>> I am planning to make a branch of my code available on github.com so
>>> everybody who like can follow my daily work on the proje

Re: [pygame] move problems

2009-04-10 Thread Zack Schilling
Tuples are immutable. Strictly speaking, that means that their  
structure cannot change after definition. In practical use, tuples  
will contain ints, floats, or strings, all of which are also  
immutable. Since you can't change an int without "replacing" it, you  
can't change an int in a tuple without replacing the whole tuple.


tl;dr: You need to either recreate the tuple or use a list.

-Zack

On Apr 10, 2009, at 11:29 AM, Yanom Mobis wrote:



ok, thanks! by the way, python2.6 won't let me change just one part  
of a tuple...

--- On Thu, 4/9/09, Brian Song  wrote:

From: Brian Song 
Subject: Re: [pygame] move problems
To: pygame-users@seul.org
Date: Thursday, April 9, 2009, 10:26 PM

Yea... Jakes method would do.. or you can just simplify it

spaceship_speed = 10

if keys[K_LEFT]:
   x_move += -spaceship_speed
if keys[K_RIGHT]:
   x_move += spaceship_self.speed

rect = rect.move(x_move, 0)

BTW... spaceship.speed=(spaceship.speed[0]-10, spaceship.speed[1])  
is unnecessary. No point in rewriting the whole list when your only  
changing one part


On Thu, Apr 9, 2009 at 9:56 PM, Jake b  wrote:
Print out .speed to see what the values are.

example: in IDLE

>>> from euclid import Vector2

>>> class Ship():
def __init__(self):
self.speed = Vector2(0,0)
self.loc = Vector2(0,0)
def accel(self, xvel, yvel):
self.speed += Vector2(xvel, yvel)
def update(self):
self.loc += self.speed
def __repr__(self): return "s=%s, l=%s" % (self.speed, self.loc )
>>> s = Ship()
>>> s
s=Vector2(0.00, 0.00), l=Vector2(0.00, 0.00)

>>> s.accel( 10, 0 )
>>> s
s=Vector2(10.00, 0.00), l=Vector2(0.00, 0.00)

>>> s.update()
>>> s
s=Vector2(10.00, 0.00), l=Vector2(10.00, 0.00)

>>> s.update()
>>> s
s=Vector2(10.00, 0.00), l=Vector2(20.00, 0.00)

--
Jake






Re: [pygame] move problems

2009-04-10 Thread Yanom Mobis
oops... that was why my spaceship wasn't moving... lol.

--- On Thu, 4/9/09, Ian Mallett  wrote:

From: Ian Mallett 
Subject: Re: [pygame] move problems
To: pygame-users@seul.org
Date: Thursday, April 9, 2009, 8:53 PM

On Thu, Apr 9, 2009 at 2:48 PM, Yanom Mobis  wrote:


if key[K_RIGHT]:
    spaceship.speed=(spaceship.speed[0]+10, spaceship.speed[1])
    print("K_RIGHT") #debug
    if key[K_RIGHT]:
    spaceship.speed=(spaceship.speed[0]-10, spaceship.speed[1])

    print("K_LEFT") #debugif key[K_RIGHT]:
    move right
if key[K_RIGHT]:
    move left 

Two K_RIGHT ?
That should cancel any speed changes out...





  

Re: [pygame] move problems

2009-04-10 Thread Yanom Mobis

ok, thanks! by the way, python2.6 won't let me change just one part of a 
tuple...
--- On Thu, 4/9/09, Brian Song  wrote:

From: Brian Song 
Subject: Re: [pygame] move problems
To: pygame-users@seul.org
Date: Thursday, April 9, 2009, 10:26 PM

Yea... Jakes method would do.. or you can just simplify it
 
spaceship_speed = 10  
 
if keys[K_LEFT]:
   x_move += -spaceship_speed
if keys[K_RIGHT]:
   x_move += spaceship_self.speed
   
rect = rect.move(x_move, 0)

 
BTW... spaceship.speed=(spaceship.speed[0]-10, spaceship.speed[1]) is 
unnecessary. No point in rewriting the whole list when your only changing one 
part
 
On Thu, Apr 9, 2009 at 9:56 PM, Jake b  wrote:

Print out .speed to see what the values are.


example: in IDLE


>>> from euclid import Vector2



>>> class Ship():
def __init__(self):
self.speed = Vector2(0,0)
self.loc = Vector2(0,0)
def accel(self, xvel, yvel):
self.speed += Vector2(xvel, yvel)
def update(self):
self.loc += self.speed
def __repr__(self): return "s=%s, l=%s" % (self.speed, self.loc )

>>> s = Ship()
>>> s
s=Vector2(0.00, 0.00), l=Vector2(0.00, 0.00)


>>> s.accel( 10, 0 )
>>> s
s=Vector2(10.00, 0.00), l=Vector2(0.00, 0.00)


>>> s.update()
>>> s
s=Vector2(10.00, 0.00), l=Vector2(10.00, 0.00)


>>> s.update()
>>> s
s=Vector2(10.00, 0.00), l=Vector2(20.00, 0.00)



-- 
Jake





  

[pygame] Networking library

2009-04-10 Thread Chris McCormick
Hi All,

I posted this as a project page on the pygame website, but I'm not getting much
traction with my library, so I thought I'd post it here to see if anyone is
interested.

Basically it's a [hopefully] super-easy-to-use networking library that works
well with Pygame too. Included is a simple networked whiteboard demo written in
pure Pygame.



Have fun, and please let me know what you thik, or if you find bugs, or need 
help.

Best,

Chris.

---
http://mccormick.cx


[pygame] PyConsole IN Pygame?

2009-04-10 Thread Campbell Barton
Hi, have been writing basic console in blender3d's game engine but I
was thinking that anyone else trying to write an in-game console (like
in quake :) ) would have to do almost the same things.
There is just some differences when you are getting events directly,
and having to do a basic readline style line editor in python which
could be generic between blender3d or any other engine.

Requirements are that you can get events, render text and store the
console object between execution's.

I was wondering if anyone had written a python console in PyGame? or
could it be useful to port as a testcase?

-- 
- Campbell


Re: [pygame] GSOC: Extending Camera support for PyGame to Mac OSX Updates!

2009-04-10 Thread el lauwer

Hoi,

Those mask functions sound useful. Do you think it would be a good  
idea to
implement a kalman filter in pygame that can be used for color based  
object

tracking.

Is there a good place I can find computer vision related information.

Grtz


On 9-apr-09, at 18:08, Nirav Patel wrote:


Excellent.  Making your code available as you work on it is a great
idea, especially for something like this that needs to be tested on a
wide range of hardware.

About pattern recognition, something like face recognition is probably
too heavy for pygame purposes and would be better suited for pyehci or
opencv-python.  However, extending some of the basic computer vision
stuff would certainly be useful, like higher or even arbitrary moments
[0] in masks, thresholding with hysteresis, hole detection in masks, a
mask to surface function, etc.

Nirav

[0] http://en.wikipedia.org/wiki/Moment_(mathematics)

On Thu, Apr 9, 2009 at 11:44 AM, el lauwer   
wrote:

Hoi,

I recently posted my proposal for GSOC to socghop. There where some  
comments
about the content, so I have updated my proposal, and hereby posted  
it to

this mailing list so guys can comment further on my proposal...


Rene Dudfield maid the following remark about my original proposal:

"
Also a section on user testing would be good.  Where you ask others  
to
download pygame to run your tests - to make sure it works ok with  
their

computer/camera.

Finally a change in your proposal to seek feedback from the  
community on
what changes you will do after the osx stuff is finished would be  
good.
 Since I have a feeling that you should have some time left over at  
the end.

"
I am planning to make a branch of my code available on github.com so
everybody who like can follow my daily work on the project.
Later on in the project I intend to make some blog post about my  
work and

post them on reddit.com/r/python, reddit.com/r/mac,
pygame ML and other communities so people can test my code. I have  
2 mac at

home and know some other people with macs who
would be willing to test out my work.

Pattern recognition is a complicated subject, But I think that it  
would be a

good thing if there where some basic pattern recognition
included like a steering wheel or a face. This would allow any gygame
programmer to use this feartues in there game without any
additional work. A possible interesting project to experiment with  
could

be http://code.google.com/p/ehci/wiki/pyehci

If you have any suggestions, remarks or questions please comment.

original
proposal: 
http://socghop.appspot.com/student_proposal/show/google/gsoc2009/abe/t123872941171
updated
proposal: http://socghop.appspot.com/document/show/user/abe/gsoc_updates


=

Updated proposal:

Instructions

Start by getting in contact with the mentor(s) familiar with your  
proposed
project.  They will help you polish your proposal and introduce you  
to the

developer team you'd be working with over the Summer.



Summary:

Nirav Patel has recently implemented camera support into pygame as  
a way to
interact with a game. However, this camera module is limited to the  
Linux
platform. The goal of my project is to extend this camera module to  
the Mac
OSX platform, and thus extending the portability of games written  
in pygame

that use a webcam as mean to interact with the player.

I will be using the OSX QiuckTime multimedia framework to work with  
the
camera. The camera module shall be implemented in C as a python  
extension.
It is my intension to fully port the capabilities of the existing  
camera
module. If there are any existing capabilities in the QT Isight  
framework,

that could be useful to have in the pygame module, I will make these
available by writhing a wrapper around them.

I will use pyobjc to experiment during the project. For the final  
code I

will use objc and C wrappers,since pyobjc is no longer used in
pygane.

When I am finished implementing the camera module for OSX, I will  
work on
optimizing the existing code, like optimizing the sbggr8_to_rgb  
function.
Ather this I will write documentation and a simple game to  
demonstrate the

capabilities.

I am planning to make a branch of my code available on github.com so
everybody who like can follow my daily work on the project.
Later on in the project I intend to make some blog post about my  
work and

post them on reddit.com/r/python, reddit.com/r/mac,
pygame ML and other communities so people can test my code. I have  
2 mac at

home and know some other people with macs who
would be willing to test out my work.

Pattern recognition is a complicated subject, But I think that it  
would be a

good thing if there where some basic pattern recognition
included like a steering wheel or a face. This would allow any gygame
programmer to use this feartues in there game without any
additional work. A possible interesting project to experiment with  
could

be http://cod

Re: [pygame] pygame for portable python

2009-04-10 Thread Andre Krause
hi René,

first, i introduce them to k-turtle, a logo variant and the probably most
easiest way to get into programming. moving that turtle on-screen and drawing
simple geometric things is quite intuitive.

then, after 4 sessions ( 1 session per week) i switch to python using python
portable. python portable is fantastic: i can put it on a network drive, they
can put it on their usb-stick and do their homeworks where-ever they like and
dont have to install anything.

after some python basics (what is the interactive command line, how to print
hello, how to add some numbers, how to calculate a mean value over numbers etc)
i just start over with turtle using pythons turtle graphics. this is good - its
a recapitulation and they might get the idea that you can do same things with
different computer languages - so it doesnt really matter what language you
actually speak.

so - i understand your point that most modules are not yet python 3 ready,
but i only use pyturtle and pygame. and its a very basic total beginners course,
 so they wont encounter any great differences between 2.x and 3.0 in codebooks,
as i only teach very fundamentals like variables, loops etc. its a course for
university freshman.

ok, long writing, short message: i would need pygame for 3.0 in about 4-5 weeks.

thank you very much !

René Dudfield wrote:
> Hi,
> 
> python 3.0 is *not* so good to teach.  Most of the available tutorials,
> and books use 2.x.  Most of the available code uses 2.x
> 
> Major modules like numpy, pyopengl, and 5000+ other modules are not
> ready for python3 yet.
> 
> It's just not ready yet (even the python developers say that).
> 
> 
> However, when are you teaching it?  We might be able to get a python3
> release of pygame ready in time.
> 
> 
> cheers,
> 
> 
> 
> 
> On Fri, Apr 10, 2009 at 6:58 AM, Andre Krause  > wrote:
> 
> dear list, i need pygame for
> 
> www.portablepython.com 
> 
> i need it for teaching programming to total beginners. i choose
> python 3.0.1
> version of portable python, because it avoids some problems that
> would confuse
> programming beginners ( for example the integer division problem)
> 
> later in the course i introduce pygame and let them program a very
> simple
> breakout like game and a baloon pop game.
> 
> question: is pygame already compatible with python 3.0.1 ?
> 
> 
> i tried installing the binary release:
> 
> "pygame-1.8.1.win32-py2.6.msi ~  1.4M (python2.5.4 is the best
> python on windows
> at the moment)"
> 
> would it help if i would try a svn - nightly build version ?
> 
> 
> currently, i get the error message:
> 
> 
> "Traceback (most recent call last):
>  File "", line 248, in run_nodebug
>  File "C:\Dokumente und Einstellungen\herc\Eigene
> Dateien\module1.py", line 2,
> in 
>from pygame import *
>  File "c:\PortablePython3\App\lib\site-packages\pygame\__init__.py",
> line 70
>raise NotImplementedError, MissingPygameModule
> ^
> SyntaxError: invalid syntax"
> 
> 
> kind regards and thanks in advance !
> 
>