In the previous part of the series we wrote a basic Panda3D app. Here’s the test.py file we created, this time without comments so that you can see how long it actually is:
from direct.showbase.ShowBase import ShowBase
class Slugrace3D(ShowBase):
def __init__(self):
ShowBase.__init__(self)
app = Slugrace3D()
app.run()
Table of Contents
Running your app
We used the Run Python File in Terminal button in the upper right corner to run the app. I also mentioned it wasn’t the only way to run your app. So, let’s see how we can run a Panda3D app in Visual Studio Code (or any other app, to be precise).
1) the Run Python File in Terminal button
The first way to run the app is by pressing the Run Python File in Terminal button in the upper right corner (A). This is what we already did. Here you can see the application window (B) and the terminal (C).
2) Run the Panda3D App Without Debugging in the Run menu
You can also go to the Run menu and select Run Without Debugging:
3) Start Debugging option in the Run menu
There is also the Start Debugging option in the Run menu. You can choose it and then select a Debug Configuration. Go ahead and select the first option, Python File:
4) Hotkeys
For the previous two options you can also use hotkeys:
– F5 to start debugging
– Ctrl + F5 to run without debugging
5) Context menu
You can also right-click anywhere in the editor tab where the code of your file is and select Run Python File in Terminal:
That’s it for today. You know what a basic Panda3D app looks like and how to run it. In the next part we’ll learn how to configure our project.
Here’s the video version of this article: