string / split method on ASCII code?

castironpi at gmail.com castironpi at gmail.com
Wed Mar 12 18:04:48 EDT 2008


>    import re
>    splitter_re = re.compile(chr(174) + '|' + chr(175))
>    for line in file(FILENAME):
>      parts = splitter_re.split(line)
>      do_something(parts)
>
> and then go find a large blunt object with which to bludgeon the
> creator of the file... :)

p>> creator= CreatorOfTheFile()
p>> creator.bludgeon
<bound method CreatorOfTheFile.bludgeon of <__main__.CreatorOfTheFile
object at [snip]>>
p>>



More information about the Python-list mailing list