![]() |
VOOZH | about |
cd ~
mkdir check cd check touch file1.py
which pythonFor python 3
which python3
/usr/bin/python3 then write the below command in the starting of the script.
#!/usr/bin/python3So the python script would look like
pwdLet it be
/home/usr/check
$PATH variable. For this type in terminal
sudo nano .bashrcBefore this command make sure that you are in the home directory. Then add this line in the file
export PATH=$PATH:/home/dev/checkThis will get added to the path variable. Then type
source ~/.bashrc
file1.pyThis will create the four directories in the check folder. Now any python file placed in the check directory we can be executed from anywhere in the terminal by typing the file name.