I'm defining a bash function in my .bash_profile
so that I can run a certain Python script from any directory. My function is something like this:
func() { python -i ~/Scripts/script.py }
It works perfectly from my home directory, but it cant find the directory ./Scripts/script.py
if run from anywhere else.
The error message is:
/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'Projects/sym.py': [Errno 2] No such file or directory
Shouldn't the ~
initially direct to the home directory anyways?
/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'Projects/sym.py': [Errno 2] No such file or directory