PYTHON - What??
7 answers - 342 bytes -

I've downloaded Python 2.4 and am interested in the study of it, since some 3D programs I know use it. But, looking into the tutorials and such, I have no information on what Python is used for? When you compile a Python script it isn't a .exe it's a "Compiled Python Script". I'm really confused, please help.
:)
No.1 | | 364 bytes |
| 
Python is a scripting language. It is not ment to be compiled. You run the "text" file. You can compile it to exe files, or even to Java Byte code, but it was first of all ment as a scripting language. So said in an other way (without lying too much) the intepreter you have downloading is reading the text file on the fly and then does what it says.
- -
No.2 | | 226 bytes |
| 
Ok... so... I noticed that Blender3D allows your game to run Python scripts. Is this what Python is for? A scripting language for your program?
If yes, how does this be implemented into say a Visual Basic application?
No.3 | | 2285 bytes |
| 
When you are using scripting in application it has a few different purposes.
If you are in a game programming team (at least if it is big), you are bound to have people in the team that can't do programming, or isn't very good, like the 3D modellers and artists. To make these test what they make in the engine or what ever, it is usual to have a scripting interface. Scripting is much easier and faster to grasp for a non programmer, and can allow a modeller or what ever to test his models in the engine with a few easy simple lines.
When you have a big project like any AAA game today, compiling time is really high. It is not unusal that it takes many minutes to compile the whole thing. If you just want to test out something or tweak values, then it will be very frustrating to have to use 5min++ to comile it every time you have just changed a value or two. Then it is much easier to have a scripting interface, so you can just change the script file (a text file) and then start the game over again without the need for compilation.
If you are debugging something, like if you do certain things with mouse or keyboard, then it is not easy to make the same thing happen over and over again. You probably understand how hard it will be to press the same buttons at the exact same point many times after each other. Then it can be nice to have a script interface where you can code the key events so they will be performed at the right time, so you can see step for step what is actually happening.
Big game engines might often ONLY have a script interface to code the whole game. I am not very pro for these things, because it hides away too much for you. But it makes the development time go down drasticaly. You simply set up loading scripts and behaviour scirpts and so on, and you code the whole game, or parts of it like that.
Now that was a few things you can use scripting in games for. There is probably many other ways to use it too. I have never used scripting in any of my VB games, but if you want to know more about how it works, here is a good link for you:
http://www.codesampler.com/miscsrc.htm (both lua and costum scripting languages)
http://www.codesampler.com/python.htm (python mainly)
- -
No.4 | | 29 bytes |
| 
Thanks a lot, that helped :)
No.5 | | 50 bytes |
| 
No problem...just happy to help out.
- -
No.6 | | 53 bytes |
| 
DoomSharp is too complex even for Python to handle :D
No.7 | | 248 bytes |
| 
Like NoteMe said, it is possible to compile to exe.
However, you need an extra program to do it.
for example py2exe
http://www.py2exe.org/
Jython (http://www.jython.org/) is an implementation of Python written in 100% Pure Java