title: python can't open file... [Errno 2] No such file or directory
body: <p>First, it works on my work computer, but doesn't work on my home desktop.
  Second, I've explored several previous answers, with no luck. Perhaps I just didn't read the ONE that has my solution.</p>
  
  <p>I want to run an executable python script from anywhere (it takes one string argument). My solution is to use a bash alias in .bashrc:</p>
  
  <p>I have tried several variants:</p>
  
  <pre><code>alias tlog="~/projects/tlog/tlog.py"
  alias tlog="/c/cyg/home/&lt;my_username&gt;/projects/tlog/tlog.py"
  alias tlog="C:\\cyg\\home\\&lt;my_username&gt;\\projects\\tlog\\tlog.py"
  alias tlog='"/c/cyg/home/&lt;my_username&gt;/projects/tlog/tlog.py"'
  alias tlog='"C:\\cyg\\home\\&lt;my_username&gt;\\projects\\tlog\\tlog.py"'
  alias tlog="python ~/projects/tlog/tlog.py"
  </code></pre>
  
  <p>None of them work, the respective outputs are:</p>
  
  <pre><code>C:\Python27\python.exe: can't open file '/home/&lt;my_username&gt;/projects/tlog/tlog.py': [Errno 2] No such file or directory
  C:\Python27\python.exe: can't open file '/c/cyg/home/&lt;my_username&gt;/projects/tlog/tlog.py': [Errno 2] No such file or directory
  bash: C:cyghome&lt;my_username&gt;projectstlogtlog.py: command not found
  C:\Python27\python.exe: can't open file '/c/cyg/home/&lt;my_username&gt;/projects/tlog/tlog.py': [Errno 2] No such file or directory
  bash: C:\cyg\home\&lt;my_username&gt;\projects\tlog\tlog.py: command not found
  C:\Python27\python.exe: can't open file '/home/&lt;my_username&gt;/projects/tlog/tlog.py': [Errno 2] No such file or directory
  </code></pre>
  
  <p>So for a sanity check, I did this:</p>
  
  <pre><code>$ cd ~/projects/tlog
  $ ls
  logs  prev_log_date  tlog.py
  </code></pre>
  
  <p>Yep it's there... so does it run?</p>
  
  <pre><code>$ ./tlog.py "TEST"
  yadda yadda it worked
  </code></pre>
  
  <p>Yep, so now:</p>
  
  <pre><code>$ ~/projects/tlog/tlog.py "TEST"
  C:\Python27\python.exe: can't open file '/home/&lt;my_username&gt;/projects/tlog/tlog.py': [Errno 2] No such file or directory
  </code></pre>
  
  <p>Well... what about</p>
  
  <pre><code>$ more ~/projects/tlog/tlog.py
  #!/usr/bin/env python
  """
  tlog - tlog docstring
  """
  ...rest of file...
  </code></pre>
  
  <p>Yep, it's still there. Anyone got an answer for me?
  For reference:</p>
  
  <pre><code>$ ls -la
  ...more files...
  -rwxrwxr-x+ 1 &lt;my_username&gt; &lt;my_username&gt; 6376 Nov 10 17:59 tlog.py
  $ cd ..
  $ ls -la
  ...more files...
  drwxr-xr-x+ 1 &lt;my_username&gt; &lt;my_username&gt; 0 Nov 10 17:59 tlog
  $ python --version
  Python 2.7.10
  </code></pre>