Filename tricks in python
<p>I have a folder containing my books that are in various formats (.pdf, .djvu, .dvi). and they all follow the format:</p>

<p>[Name of the Book] - [Author].[an identifier indicating if it searchable or not].[filetype]</p>

<p>I want to make a list of my books that is of the format (x,y,z,t) where x is the name of the book, y is the author, etc. My problem is that when I do:</p>

<pre><code>for file in os.listdir('/home/username/Books'):
</code></pre>

<p>file is a string, thus immutable, so I cannot change it.</p>
