i saw someone do this in a video suppose i have a python code called code.txt and i executed it using this command in powershell
python .\code.txt
what is the use of the .\
here
it also happens to work with ./
CodePudding user response:
It's just a notation referring to the current directory.
python .\code.txt
, python ./code.txt
and python code.txt
produce the same result, as your file needs to be in current cmd/shell directory to be run this way. Or else you could execute it outside current cmd/shell directory specifying the full path, as python C:\Users\Desktop\code.txt
.