Hot answers tagged python
Perhaps the easiest way to do this is to place your script in $HOME/bin and making sure that the permissions are set to executable: chmod +x $HOME/bin/script.py Now you should be able to run the script from any directory.... A couple of other points to be aware of: Ensure that $HOME/bin is in your $PATH, for Ubuntu this will be set by default in ...
Put this line in your .bashrc assuming you're using bash as shell: export PATH=/path/to/your/script/:"$PATH" You can use vi, nano or gedit to edit this line in the end of the file. Make sure your script is set to executable mode, if it's a bash script: chmod +x script.sh Or if it's a Python script: chmod +x script.py On your script indicate their ...
A python script should start with a python shebang. Remove the REPL output: Python 2.7.10 (default, Oct 14 2015, 16:09:02) [GCC 5.2.1 20151010] on linux2 Type "copyright", "credits" or "license()" for more information. >>> And change the first line to either #!/usr/bin/env python or (assuming your python is in /usr/bin) #!/usr/bin/python
Just so that another unfortunate soul doesn't go on the same wild goose chase, as noted by a comment here, as of Feb 2015 you can now do sudo apt-get install python3-pyqt5 Worked like a charm for my script in pycharm
Only top voted, non community-wiki answers of a minimum length are eligible