Scanner class

Arnaud Delobelle arnodel at googlemail.com
Mon Dec 1 23:42:24 CET 2008


George Sakkis <george.sakkis at gmail.com> writes:

> Is there any stdlib or (more likely) 3rd party module that provides a
> similar functionality to the java.util.Scanner class [1] ? If not,
> would there be any interest in porting it (with a more Pythonic API of
> course) or are there better alternatives ?
>
> George
>
> [1] http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html

Have you looked at:

>>> import re
>>> re.Scanner
<class re.Scanner at 0x759f0>

Last time I checked it was undocumented though, although I vaguely
recall a Cookbook recipe.  Ah here it is:

http://code.activestate.com/recipes/457664/

HTH

-- 
Arnaud



More information about the Python-list mailing list