title: How to get absolute path of a pathlib.Path object?
body: <p>Making a path object with <code>pathlib</code> module like:</p>
  
  <pre><code>p = pathlib.Path('file.txt')
  </code></pre>
  
  <p>The <code>p</code> object will point to some file in the filesystem, since I can do for example <code>p.read_text()</code>.</p>
  
  <p>How can I get the absolute path of the <code>p</code> object in a string?</p>
  
  <p>Appears that I can use for example <code>os.path.abspath(p)</code> to get the absolute path, but it awkward to use an <code>os.path</code> method, since I assume that <code>pathlib</code> should be a replacement for <code>os.path</code>.</p>