r/AskComputerScience • u/scholastic_noob • Feb 14 '21
How does a python program work?
Hi,
So sorry if this is a stupid question but I am trying to learn computer science and someone suggested I learn to code and they suggested the python language. So I do this exercise that is very simple and all I type in the code is:
print(“Hello World!”)
I then learned to maneuver to the program directory in the terminal and to run the program using the command:
python3 Hello.py
However, what I am confused about is how exactly the computer knows from python to display the text. What is the python3 command actually do here? Because if it isn’t used it does not work. Now my guess is that for other languages I need to use a command similar to python3 for each respective language. I am just not sure what the command is doing and I am hoping someone could explain it to me. Sorry if this is a dumb question, I am only thirteen and I am trying to get smarter.
1
u/Destroyer_The_Great Feb 15 '21 edited Feb 15 '21
I cant really help you with your question too much but just wanted to offer recouses and tips. I was at this point a while ago. I would suggest learning c++ first and once fundamentals are down move on to python, at least then you can go from compiler to interpreter. It's a but of a chuck in the deep end but worth it. I wasn't a python programmer until a few months ago and it was really simple to learn python once I had c++ knowledge. It all really depends on what your writing and what your gonna use it for. I use c++ mostly for game development. I would suggest learning c++. Could I also suggest these tutorials: https://youtu.be/HBxCHonP6Ro for python and the same channel does other languages too. If you follow along It will help you guaranteed. The solo learn app will also help you along pretty nicely too: https://play.google.com/store/apps/details?id=com.sololearn
Edit: If you do go the c++ route I would suggest using the Dev-C++ compiler, fast, easy to use and customizable. It is pretty outdated but my favourite ide then there is microsoft visual studio wirch I use for my bigger projects and projects requiring libraries. Dev-C++: https://sourceforge.net/projects/orwelldevcpp/
Visual Studio: https://visualstudio.microsoft.com/