Complete newbie a bit confused

Hi. Im totally new to Panda and thought id check it out as it looks very intresting. Im just a bit confused how Python works with it. Once you have written your code how do go about compiling it, and once compiled, do you need python installed to run the .exe file. Also where abouts do you store your code (the .py) files to work with, in the python directory or just simply in the panda directory as example code referes to models in the panda3d/models directory (code says: "loader.loadModel(“models/environment”). No matter where I store the .py files they always seem to load the models (like its built in to look in the panda3d/models directory). I am just wondering for when it comes to compile if it will be looking in the correct directoty

I hope you know what im talking about :smiley:

Oh yeah, once compiled (and if you do or dont need python) do you need to include any .dll files from panda for it to run on other machines

Compiling a panda program is something you will have to do on your own for now. You can search for py2exe in these forums as others have discussed how to do this.

As far as storing the python code, you should be able to store it anywhere. Panda uses its own version of python (ppython) to run the files which has a path in the system environment variables(in windows). The default models are loaded using a path stored in panda’s config.prc file (located in your-panda-directory/etc) Thats why you can load the default models from anywhere. You can specify your own default model, sound and texture paths in this file.

Note that we are assuming that by “compiling” you mean “making an .exe file for distribution to other people”. If you just mean “how do I run a Python program”, then you should understand that normally Python is not compiled in the same sense that C++ is, but the Python interpreter loads and runs the .py files directly.

If you need an answer on the total-newbie-stage; here it is:

You write your code in any editor (notePad, words, idle, emacs …)
Then save the file as text with a

You may wanna make /YourFolderName as a subdirectory of Panda

  • be sure to keep track of your model folder (you may want it as a subdirectory of /YourFolderName.)

Once you have written the code,
you take the command Prompt
go to /YourFolderName
type ppython YourFileName (yes two p’s)

If your program works (start with examples from either the samples or the tutorial) it now opens a new window and voila!!
(no linking or making or other C++ stuff)

The relationship of Python and Panda is that Python is a scripting language, and Panda is a 3D engine.
You can also write the programs in C++ and wrap them with a tool like SWIG.
Python is normally included in the Panda-files you download from this site.
Imho, the only trace of Python is that we (some of us) write the code in that language.

Honestly, I don’t know if you will need python to run the .exe, but I seriously doubt it (as far as I know the .exe is independent of the code language) - please correct me if I’m wrong.

The thing about portability and .exe-files you can worry about later.
As you can read from the above, it can be done.

Good luck with Panda3D (it’s fun :slight_smile: )

Yeah it was compiling to an .exe, thanks for the replies, things are a lot clearer now :smiley: