Python and Pygame.

Member
Posts: 312
Joined: 2006.10
Post: #1
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:
Quote: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?
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #2
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.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Member
Posts: 312
Joined: 2006.10
Post: #3
Ahh, that makes sense Smile
Quote this message in a reply
Member
Posts: 20
Joined: 2006.06
Post: #4
I picked up the pre-compiled (2.4) packages (python2.4, pygame, pil, numarray, etc) from here and ran into no issues. (I installed py2app through MacPorts).

Oh, and Python works great for making applications and games.
Quote this message in a reply
Member
Posts: 312
Joined: 2006.10
Post: #5
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.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #6
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.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #7
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.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #8
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.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #9
Quote this message in a reply
Moderator
Posts: 529
Joined: 2003.03
Post: #10
Interesting. I wonder if they will include Python 2.5.

"Yes, well, that's the sort of blinkered, Philistine pig-ignorance I've come to expect from you non-creative garbage."
Quote this message in a reply
Member
Posts: 312
Joined: 2006.10
Post: #11
Thanks for your suggestions! I think Python is a better path for me Smile

Both seem like comprable bridges... Ruby has a nice supporting site http://www.rubycocoa.com
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Python for games? DEV_JS 2 2,459 Apr 12, 2013 05:15 PM
Last Post: Evan Stallings
  Python Compiler wyrmmage 3 4,000 Jul 30, 2009 10:14 PM
Last Post: wyrmmage
  Very stupid question about Python on OS X Durandal 10 8,347 Dec 17, 2008 09:33 AM
Last Post: Duane
  pygame or lingo? hertzcastle 6 4,313 Mar 19, 2008 01:13 AM
Last Post: hertzcastle
  pygame framework foosh 0 2,298 Feb 29, 2008 02:09 AM
Last Post: foosh