How to create a symbolic link to a Python code on Linux?

Asked

Viewed 613 times

5

I want to run a simple Python code I created from anywhere on my system.

I know to do this with a shell script just turn the command ln -s /home/user/script.sh /usb/bin/script, but would like to know how to do the same with a "code.py".

1 answer

4


It’s the same:

ln -s /home/usuario/codigo.py /usb/bin/script
  • Actually, it’s the same command. The error I was encountering when calling my code was because I didn’t set the correct interpreter. In my case, the problem was solved by adding "#! /usr/bin/python2" at the beginning of the code. Thanks for the help.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.