![]() ![]() To make ~/.local/bin content executable the same way /usr/bin does type $PATH = $PATH:~/local/bin (you can add this line to your shell rc file, for example ~/.bashrc).įile extensions aren't necessary in UNIX-like file-systems. If you want a playground, a good idea is to invoke mkdir ~/.local/bin and then put scripts in there. Note that this mainly should be done for complete, compiled programs, if you have a script that you made and use frequently, then it might be a good idea to put it somewhere in your home directory and put a link to it in /usr/bin. ![]() In addition, you can also use ln -s hello.py /usr/bin/hello to make a symbolic li nk hello.py to /usr/bin under the name hello, then run it by simply executing hello.Type chmod a x hello.py to tell Linux that it is an executable program.save your hello.py program in the ~/pythonpractice folder.#! /usr/bin/python3 print ( 'Hello, world!' ) Open up your favorite text editor and create a new file called hello.py containing just the following 2 lines (you can copy-paste if you want):.Create a folder on your computer to use for your Python programs, such as ~/pythonpractice. EDIT PYTHON ON LINUX SERVER INSTALLIf you have both Python version 2.6.1 and Python 3.0 installed (Very possible if you are using Ubuntu, and ran sudo apt-get install python3 to have python3 installed), you should run python3 hello.py
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |