I can not run Python

So, I'm pretty new to FreeBSD and got a task to make a game in Python. I have installed Python and got a file saying "Run python" within my applications in KDE Plasma, but when I press it nothing happens. How do you set it up and get it running? Or did I install it in the wrong way?
 
I have installed Python
How?
got a file saying "Run python" within my applications in KDE Plasma
What exactly did you install?

How do you set it up and get it running?
Well, you could open a shell or terminal and enter the python3.11 command. That will land you in Python's REPL. But most people would just open an editor and start writing Python code. Then run that script using python3.11 myscript.py for example. Or add a so-called "shebang" line, make the file executable and run it directly.

Maybe you'd be more at home with an "IDE" like devel/thonny?
 
Hi axel.edstrom
You have to 1st check Python version at your BSD side.. SirDice is right
You can also install ( if not installed yet) VS Code.

# python --version Python 3.11.9
 
I would start the way SirDice suggestion: Open a shell, simply say "python", and you should be inside the python shell. Say "print(3.14)", and you should see the number printed. Note: The command "python" by itself may not work, but python3 will, and if you installed it recently, python3.11 definitely will. Set some variables, write an if statement, it should all work. Once you have that, write a small python script (hello world style), and start it with the shebang line:
#!/usr/local/bin/python3
mark the script as executable with "chmod a+x ...", and it should run.

Once you have those first steps done, then maybe install a comfortable development environment, such as VS Code, if you enjoy that. There are many development styles.
 
Back
Top