title: How to convert ~/. path to absolute path
body: <p>I have the following file: <code>~/.config.txt</code> which is located in <code>/root/.config</code>. In order to avoid hardcoded paths in my <code>Python</code> file, how can I always replace (and correctly refer) to a <code>~/</code> path as <code>&lt;home&gt;</code> in Python?
  This way I could replace <code>~/.config.txt</code> by <code>/root/.config</code> if <code>/root/</code> was my home directory? </p>