<br><a href="http://stromberg.dnsalias.org/svn/bufsock/trunk">http://stromberg.dnsalias.org/svn/bufsock/trunk</a> does it.<br><br>$ cat double-file<br>daemon:x:1:1:daemon:/usr/sbin:/bin/sh<br>bin:x:2:2:bin:/bin:/bin/sh<br>
sys:x:3:3:sys:/dev:/bin/sh<br>sync:x:4:65534:sync:/bin:/bin/sync<br>games:x:5:60:games:/usr/games:/bin/sh<br>man:x:6:12:man:/var/cache/man:/bin/sh<br>root:x:0:0:root:/root:/bin/bash<br>lp:x:7:7:lp:/var/spool/lpd:/bin/sh<br>
mail:x:8:8:mail:/var/mail:/bin/sh<br>news:x:9:9:news:/var/spool/news:/bin/sh<br>uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh<br>proxy:x:13:13:proxy:/bin:/bin/sh<br>benchbox-dstromberg:~/src/home-svn/bufsock/trunk i686-pc-linux-gnu 8830 - above cmd done 2011 Sat Aug 27 06:19 PM<br>
<br>$ python<br>Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)<br>[GCC 4.4.5] on linux2<br>Type "help", "copyright", "credits" or "license" for more information.<br>>>> import bufsock<br>
>>> file_ = open('double-file', 'rb')<br>>>> bs = bufsock.bufsock(file_)<br>>>> bs.readto('oo')<br>'daemon:x:1:1:daemon:/usr/sbin:/bin/sh\nbin:x:2:2:bin:/bin:/bin/sh\nsys:x:3:3:sys:/dev:/bin/sh\nsync:x:4:65534:sync:/bin:/bin/sync\ngames:x:5:60:games:/usr/games:/bin/sh\nman:x:6:12:man:/var/cache/man:/bin/sh\nroo'<br>
>>> bs.close()<br>>>><br><br>Don't let the name fool you - it's not just for sockets anymore.<br><br><div class="gmail_quote">On Fri, Aug 26, 2011 at 11:39 AM, greymaus <span dir="ltr"><<a href="mailto:greymausg@mail.com">greymausg@mail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br>
Is there an equivelent for the AWK RS in Python?<br>
<br>
<br>
as in RS='\n\n'<br>
will seperate a file at two blank line intervals<br>
<br>
<br>
--<br>
maus<br>
 .<br>
  .<br>
...   NO CARRIER<br>
<font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>