I wrote a very simple python program in hope that I could run it from the Windows command line. In the terminal I type python.exe hw.py and instead of running the program I get the python interpreter. Does anyone know what I'm doing wrong?
Program:
def hello():
return "Hello World!"
if __name__ == "__main__":
hello()
I've also tried even simpler programs such as
print("Hello world!")
and
return "Hello World!"
but nothing works. The goal here is to get output in the console. Thanks!
python.exe hw.py? Orpython.exe \n hw.py?my_script.pypython path/to/your/file/hw.py