PDA

View Full Version : Python and Pygame.


bronxbomber92
2006.12.28, 11:40 AM
Hey, I used the autmatic installer for pygame, and it said all was complete and installed correctly, then I go to try an example script, just to setup a window. I get this error:Traceback (most recent call last):
------
File /Users/jeddhaberstro/Desktop/test.py, line 1, in ?
import pygame, sys,os
------
ImportError: No module named pygame So obviously, it can't find pygame...

Also, does anyone have any experience with Python? I just picked it up yesterday, and it seems to be a delectable language! How fast is it compared to Java, since they are both compiled into bytecode?

Skorche
2006.12.28, 07:41 PM
It's not going to be as fast as java, but it it is arguably easier. The python bytecode isn't the same as java's, it's more preparsed than it is compiled.

edit: Heh, typing that on my Wii was a bad idea. Apostrophes look like back-ticks.

bronxbomber92
2006.12.29, 12:26 PM
Ahh, that makes sense :)

kordova
2006.12.29, 04:27 PM
I picked up the pre-compiled (2.4) packages (python2.4, pygame, pil, numarray, etc) from here (http://pythonmac.org/packages/) and ran into no issues. (I installed py2app through MacPorts).

Oh, and Python works great for making applications and games.

bronxbomber92
2006.12.31, 01:16 AM
Yep, that worked (all though, I swear I all ready installed that :/)! Thanks

Slightly off-topic question: Which is more mature, RubyCocoa or PyObjc? They both seem pretty similar, but python and PyObjc seems more mature.

Skorche
2006.12.31, 02:21 AM
I'd say they're about the same, but haven't used either extensively. However, RubyCocoa has recently gotten Apple's blessing, so it might become much more desirable in the near future.

OneSadCookie
2006.12.31, 03:33 AM
The Leopard PR stuff says that you'll be able to program Cocoa from either Python or Ruby, so I expect they intend to integrate both PyObjC and RubyCocoa.

Personally, I like PyObjC better, at least for now.

Skorche
2006.12.31, 03:58 AM
Hadn't heard that. Good to know.

In that case, it would probably be easier to get help with PyObjC due to Python's greater popularity.

OneSadCookie
2006.12.31, 06:13 AM
Reference: http://developer.apple.com/leopard/overview/apptech.html

Leisure Suit Lurie
2006.12.31, 01:11 PM
Interesting. I wonder if they will include Python 2.5.

bronxbomber92
2006.12.31, 02:00 PM
Thanks for your suggestions! I think Python is a better path for me :)

Both seem like comprable bridges... Ruby has a nice supporting site www.rubycocoa.com