Python Bencoding using BitTorrent-bencode 5.0.8.1
<p>I'm new to python and bencoding. I need to read and write torrent files for my project using python. I have already imported the module and here's my code to parse the torrent:</p>

<p>Here's the link to my module <a href="http://paste2.org/p/1442120" rel="nofollow">http://paste2.org/p/1442120</a> which is a mod of <a href="http://pypi.python.org/pypi/BitTorrent-bencode/5.0.8.1" rel="nofollow">http://pypi.python.org/pypi/BitTorrent-bencode/5.0.8.1</a></p>

<pre><code>            import sys
            from bencode import *
            f = open('file.torrent','rb') #binary read write
            for line in f:
                    print line, 
                    print bdecode(line)
</code></pre>

<p>This throws invalid bencoded string error
If I understand correctly, the bdecode function needs one value at a time but how do I parse the torrent file? or ...</p>
