Anyone know anything about Python?

Started by R4L, Sat 28/07/2007 23:05:29

Previous topic - Next topic

R4L

Well, I do some modding for a game called Frets on Fire. It was made in python, and it's like Guitar Hero for Playstation 2.

I downloaded Python, and all I can say is that it looks very complicated. I would like to get some opinions from anyone who has used it before. It seems like a good alternative to regular C and BASIC.

voh

Slapping rocks together is a good alternative for BASIC.

http://www.sthurlow.com/python/

Ignore the Civ IV references, it's got some good information.
Still here.

R4L

Holy crap Voh! Thanks for that!

By the way, do you have any experience with Python? Is it easy to get at first?

Gord10

I am currently modding for Mount&Blade and its module system uses Python, as well.

I can say it is not such a hard language, it came easy to me.
Games are art!
My horror game, Self

fred

Good luck w/ python, I've used it for scripting before, and it's not that hard once you get used to the syntax. 

Documentation and tutorials:
http://www.python.org/doc/

There's also pygame, a set of free python modules for game development:
http://www.pygame.org

SSH

Pyhton is awesome and pygame makes it easy to write stuff. There's even an open-source point-and-click adventure written in it: http://www.pygame.org/projects/23/300/
12

tube

Python is my scripting language of choice whenever applicable. For me it was pretty much love at first sight. :-*

Here's another great tutorial, Dive into Python by Mark Pilgrim.

scotch

#7
My favorite script language too! I'd encourage anyone to learn it, it's handy for embedding, web scripting, simple or prototype games, all sorts of stuff. And it's not horribly designed and messy like certain script languages.

I was going to recommend Dive into Python, same as tube, it's the best way to get into it if you can already code in another language (especially an OO one).

As for if it's easy... well considering it's a real language designed for real use, and primarily used by and aimed at experienced coders it's very simple to learn. It'll take longer to learn the ins and outs than when learning BASIC or PHP, simply because it supports more coding techniques and you can do more with it. But it's very clean, consistent and you should be able to write scripts very quickly.

R4L

Ha, thanks for our opinions! I downloaded ActivePython and I'll look into the stuff you guys provided. I want to learn some python so I can add more features to a game I'm currently addicted to (see first post) and learn something that could get me a job. :D

In the future that is...

deadsuperhero

I'm starting to get into Python. It's really simple, and is oddly like AGS in some aspects.
The fediverse needs great indie game developers! Find me there!

covox

I heartily recommend learning Python. One of the quickest ways to write lovely clean working code, all the benefits of OO with voluntary encapsulation, blah blah blah everyone can see it's completely brilliant and that's that ;P

I've written a Lemmings engine in it using pygame, although it's probably not a good idea to look at the source too closely as I wrote lots of it during a crash course.

R4L

Well, I opened some of the source of that game I like into Python, and it isn't much different than AGS. This is a great program! Although I need pyOpenGL, so when I get the zip and I extract to a temp folder I try to run this line:

python setup.py

It says to run this in the installation notes, but the DOS window pops up for not even a second and then nothing happens. Is this a module or something I am supposed to import, or do I install it some other way?

deadsuperhero

Out of curiousity, how hard would it be to make an AGS editor using Python? It wouldn't be an exact port, nor would it be compatible with Windows AGS games, but it would allow for developers to port their games to Linux (though, they'd have to rewrite the whole damn game, most likely)
The fediverse needs great indie game developers! Find me there!

LGM

Are you suggesting coconuts migrate?
You. Me. Denny's.

covox

Not at all! They could be carried.

R4L: You might be better off installing the .egg package available at http://sf.net/projects/pyopengl

Alliance: Yes, considering the new AGS editor is done in .NET, it could indeed be ported by someone mad enough under the basis of "anything .NET can do, Python can do better". The only problem is that since WinForms isn't very cross-platform, two parallel editors would have to be maintained and there might be issues with seeing the source code and everything would get quite hairy. Probably just better to use Wine (0.9.33 is the magic release which doesn't crash at all) and wait for Mono to catch up...

SSH

I thought about writing a python/pygame library that parallelled all the function names etc. in existing AGS scripty, which probably wouldn't be too hard, but there's a lot more to AGS than that.


Perhaps if Chris is going to re-write the compiler, we cna get him to use python syntax ;)
12

R4L

Hey thanks for that link! :D

print "AGS should stay the way it is IMO. We don't need another script change."

RickJ


R4L

Ha thats awesome Rick. Very nice! Although I still can't install PyOpenGL.

scotch

#19
I'm not sure what your problem is, but it isn't enough just to type that in the windows Run dialog, what you should do is:

Open a command prompt by typing "cmd" in the Run dialog.
Change directory to wherever you have extracted the pyopengl files, dos style (cd c:\temp\pyopengl for example)
Type the "setup.py install" command (the majority of libraries install using this command, unless they have standalone installers)

If there are any errors at least this way the window won't close straight away, and you'll be able to say what they are.

Edit: also be aware of the dependancies listed on the installation page, you'll need those before you install.

SMF spam blocked by CleanTalk