Xian_Lee![]() Member Posts: 345 From: Registered: 03-15-2006 |
First, let me point out that I'm brand new to Python. I've got some PHP under my belt, and a bit of basic understanding of programming, but I just picked up Python yesterday. The Python language doesn't seem too difficult, but I'm running into problems compiling (or "Make Applet" in the MacPython IDE) my code. Actually, that's not true, my code compiles perfectly, but my new apps won't run because the media files (images, sounds) are not getting included. When I compile an app without external files (excluding libraries), I have no problems whatsoever, and the apps run nicely. Does anybody know what I'm doing wrong? Sorry about posting such a newbie question. Thanks!!! |
Jari![]() Member Posts: 1471 From: Helsinki, Finland Registered: 03-11-2005 |
Hi xian_lee! Welcome to CCN - where no question is too noob. ![]() I havent used the py2app my self but just to make sure I have to ask, does your python program run if you just execute the script? Because you dont have to make (build) an executable in order to run your python scripts. Just making sure you know that. In Christ, ------------------ [VoHW] (Help needed) [Blog] - Truedisciple (mp3) |
Xian_Lee![]() Member Posts: 345 From: Registered: 03-15-2006 |
Thanks for the heads up! Python works just fine when interpreting, all of the files are showing up nicely, I just can't get my images to work with the compiled applet. Side-stepping a little. Is Python any good for game dev? Not like, extravagant 3D super-games, but the very fun/addicting 2D kind (current game ideas are similar to old Mega Man, Zelda, and other such classics). |
D-SIPL![]() Moderator Posts: 1345 From: Maesteg, Wales Registered: 07-21-2001 |
quote: You need to make sure that the image paths are correct. Also add the python compiler directory to the top of your scripts. Python can be used for 3D Game development. Check out PyOGRE and also 3D Cakewalk. --D-SIPL ------------------ |
Jari![]() Member Posts: 1471 From: Helsinki, Finland Registered: 03-11-2005 |
quote: Yep it sure is. We are using python for the CCN community project called Bible Dave. ------------------ [VoHW] (Help needed) [Blog] - Truedisciple (mp3) |
buddboy![]() Member Posts: 2220 From: New Albany, Indiana, U.S. Registered: 10-08-2004 |
is this too n00b?
------------------ |
CPUFreak91![]() Member Posts: 2337 From: Registered: 02-01-2005 |
Hi welcome to CCN!
quote: Actually, people use Python for 3D stuff (and games) too!
quote: It's also offtopic ------------------ "After three days without programming, life becomes meaningless.'' -- Tao of Programming Book 2 [This message has been edited by CPUFreak91 (edited March 16, 2006).] |
Xian_Lee![]() Member Posts: 345 From: Registered: 03-15-2006 |
quote: So at the top of my scripts I should have " #! /usr/bin/python " or whatever the path to the compiler is (or would that be /Developer/Python/py2app/ for the py2app compiler)? I guess what's confusing me is the fact that everything runs just peachy in intepreted form. I'm not sure that I've used py2app itself... I think I have, but I know that I've used the "Make Applet" feature in the Python IDE and the Applet Builder program included with MacPython. Anyway, thanks for the tip! |
buddboy![]() Member Posts: 2220 From: New Albany, Indiana, U.S. Registered: 10-08-2004 |
i know it's offtopic, but i just had to challenge that... ------------------ |
CPUFreak91![]() Member Posts: 2337 From: Registered: 02-01-2005 |
quote:
------------------ |
Xian_Lee![]() Member Posts: 345 From: Registered: 03-15-2006 |
quote: Weird. After more experimenting with my file inclusion issues, I found out that if I put an absolute reference to the files, it all works flawlessly. The good news is... I can now make thing that work. The bad news is... in order for them to work, all support files have to be in a predefined location. Bummer. I'm sure there's a way to make this work with relative references, but I'm content for now. Thanks for the help! [This message has been edited by Xian_Lee (edited March 17, 2006).] |
D-SIPL![]() Moderator Posts: 1345 From: Maesteg, Wales Registered: 07-21-2001 |
quote: You can compile Py files... pyc. --D-SIPL ------------------ |
Xian_Lee![]() Member Posts: 345 From: Registered: 03-15-2006 |
I'm confused now. Can python be compiled, or just made into a condensed application file? And if it can be compiled, does that mean that the compiled programs will be faster than the intepreted ones? It's been a while since I've attempted any programming that wasn't web-based. ------------------ |
buddboy![]() Member Posts: 2220 From: New Albany, Indiana, U.S. Registered: 10-08-2004 |
lol i like your signature xian_lee... i think there is a way to compile Python... lol... ------------------ |