Re: [pygame] Linux binaries
For algorithms you could try Weave, a package in SciPy, no need to compile with any compiler, it just runs, Fast. Check these http://www.scipy.org/PerformancePython comparisons out, the only thing faster than Pyrex, C++ on Weave, without the additional memory overhead of Pyrex :-) Kind Regards, Patrick Atambo. On Wed, Nov 5, 2008 at 4:57 PM, Matt Pearson [EMAIL PROTECTED] wrote: i have been doing C++ for a while now and was wondering if there was a python wrapper for it, if so can i use and compile in visual studio?? On Wed, Nov 5, 2008 at 7:53 AM, Peter Gebauer [EMAIL PROTECTED] wrote: Hi guys! I agree, just wanted to add that many iterations over trivial code benefits (speed-wise) tremendously from being written in C and accessed in Python, or at least that is my experience. :) Guess you have to weigh it against the added complexity of having to compile C code, maybe for mulitple platforms, etc. On 2008-11-05 (Wed) 13:57, Greg Ewing wrote: Patrick Mullen wrote: On Tue, Nov 4, 2008 at 12:55 AM, Greg Ewing [EMAIL PROTECTED] wrote: The only way to improve speed is to re-code the cpu-intensive parts using something more efficent, such as C or Pyrex. Or, of course, write better python code if possible in those parts. Yes, certainly -- finding a better algorithm is always the best form of optimization! -- Greg
Re: [pygame] Linux binaries
Hey there! There are some alternatives, some like automatic generation like Swig, Boost, etc, some like Pyrex, I prefer to write Python extensions in C using the standard Python C-implementation API. PyGame, being written in C, is also easy to access. As for C++, I don't know of any specific C++ API's, but then again I don't use C++ at all so I haven't looked. There's also the option of doing the reverse scenario, embedding instead of extending, you'll have to see what fits your project best. /Peter On 2008-11-05 (Wed) 08:29, Matt Pearson wrote: i agree, does the wrapper have a name, or is it on the python/pygame sites On Wed, Nov 5, 2008 at 8:13 AM, René Dudfield [EMAIL PROTECTED] wrote: yeah, best to use both! Use each tool where it is best at - and get best of both worlds! cu, On Thu, Nov 6, 2008 at 12:53 AM, Peter Gebauer [EMAIL PROTECTED] wrote: Hi guys! I agree, just wanted to add that many iterations over trivial code benefits (speed-wise) tremendously from being written in C and accessed in Python, or at least that is my experience. :) Guess you have to weigh it against the added complexity of having to compile C code, maybe for mulitple platforms, etc. On 2008-11-05 (Wed) 13:57, Greg Ewing wrote: Patrick Mullen wrote: On Tue, Nov 4, 2008 at 12:55 AM, Greg Ewing [EMAIL PROTECTED] wrote: The only way to improve speed is to re-code the cpu-intensive parts using something more efficent, such as C or Pyrex. Or, of course, write better python code if possible in those parts. Yes, certainly -- finding a better algorithm is always the best form of optimization! -- Greg
Re: [pygame] Linux binaries
im sorry if this is the wrong forum but im having an error im doing the AI example in Will McGugans Python/Pygame book The error is run() NameError: name 'run' is not defined i have the lastest gameobjects module so im kinda stumped and its not using OpenGL either thanks On Wed, Nov 5, 2008 at 7:34 PM, Bill Coderre [EMAIL PROTECTED] wrote: On Nov 5, 2008, at 4:48 PM, yanom @linuxmail.org wrote: What's Bogosort? Back in my day, we didn't have Wikipedia, we had the Jargon file, and we LIKED it. (Note that although if I am really to show my age, I have to decry the Eric Raymond update which, to a large extent, diluted the winnage of the original. But the original does not have an entry for Bogo-Sort, so there you go.) http://catb.org/jargon/html/B/bogo-sort.html It is highly educational and entertaining to read these old repositories of wordplay and politics. For instance, you probably have always frobbed things (it's part of the hacker DNA), but now you can understand the distinction between frobbing, twiddling, and tweaking, and this might actually come in handy at some point. See also the story about Magic in the Appendix.
[pygame] Geany
is there anyway to make geany python aware??(in regards to indention)
Re: [pygame] Geany
well i never tried that.but i guess i was talking about tabs ands spaces i recently had a problem with tabs messing up a function and pushing in into another one. I know python is whitespaced but im still learning how spaces and tabs work in Python world On Thu, Nov 6, 2008 at 9:29 AM, pymike [EMAIL PROTECTED] wrote: It is python aware. Make sure you have it set to Document Set Filetype Programming Languages Python Or are you referring to tabs/4 spaces? On Thu, Nov 6, 2008 at 9:18 AM, Matt Pearson [EMAIL PROTECTED]wrote: is there anyway to make geany python aware??(in regards to indention) -- - pymike Stop loling into a false sense of hilarity
Re: [pygame] Geany
I have found after quite some time that making the editor put in spaces for tabs and never having tabs in my programs saves headaches. -- Douglas E Knapp http://sf-journey-creations.wikispot.org/Front_Page
[pygame] Collision detection help - colliderect
I am trying to check a collision between b and B. b is the bullet sprite from the Bullet class, and B is the barney sprite from the Barney class. Link: http://pastebin.com/m4d7304fc Right now nothing happens when I run the game, no collision detections and no error messages. I cant figure out what I am doing wrong. It was complaining about how b isnt defined so I made it global, same with B.