OiO.lk Blog python Execute .py file from the wsl shell
python

Execute .py file from the wsl shell


I’m trying to execute a simple hello.py file from the shell (a wsl really), but apparently it doesn’t work. I used the following command to be sure to be in the directory containing the .py file:
import os
os.getcwd()
The error is always the following: NameError: name’hello.py’ is not defined. Any suggestion?

I tried many possible solutions but no one of them worked. For example I tried to write python3 hello.py without success.



You need to sign in to view this answers

Exit mobile version