title: Python subprocess doesn't execute if the path contains home directory tilde ~
body: <p>I'm trying to detect an error and restart server from django application.
  I'm using the following code:</p>
  
  <pre><code>try:
   # do something
  except:
   print('here')
   subprocess.call(['/home/my_username/restart.sh'])
  </code></pre>
  
  <p>restart.sh is as follows</p>
  
  <pre><code>#!/bin/sh
  /home/my_username/webapps/app/apache2/bin/restart
  /home/my_username/webapps/my_db/bin/cron
  </code></pre>
  
  <p>I'm using webfaction as hosting provider.
  Aboved code prints statement, but doesn't restart the server and doesn't start mysql database which is under my_db.</p>
  
  <p>Maybe I need to supply username/pass? How to do that?</p>