Oct-31-2016, 03:48 AM
i run Ubuntu Linux and have added symlinks so i can invoke python and python3 with just py and py3. this is what i have in /usr/local/bin:
i have also added python support to the bash function that handles missing commands. if a command name cannot be found it looks in the current directory for ${name}.py and if that is not found then it looks there for ${name}.py3. if found, it runs them via the appropriate python interpreter. this lets me try out new code with less typing. this is not set up for root. i still run bash for my interactive shell.
Output:lrwxrwxrwx 1 root root 16 Oct 9 02:08 /usr/local/bin/py -> ../../bin/python
lrwxrwxrwx 1 root root 17 Oct 9 02:08 /usr/local/bin/py2 -> ../../bin/python2
lrwxrwxrwx 1 root root 17 Oct 9 02:08 /usr/local/bin/py3 -> ../../bin/python3
has anyone else done the same or similar. i have also added python support to the bash function that handles missing commands. if a command name cannot be found it looks in the current directory for ${name}.py and if that is not found then it looks there for ${name}.py3. if found, it runs them via the appropriate python interpreter. this lets me try out new code with less typing. this is not set up for root. i still run bash for my interactive shell.