Scanner class

A

Arnaud Delobelle

George Sakkis said:
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:
<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
 
G

George Sakkis

George Sakkis said:
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 ?

[1]http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html

Have you looked at:

<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/

Thanks, didn't know about it. I also found Plex [1] which seems more
powerful.

George

[1] http://www.cosc.canterbury.ac.nz/greg.ewing/python/Plex/version/doc/index.html
 
A

Arnaud Delobelle

George Sakkis said:

I've also written a python module that aims to be similar to GNU flex.
You can see it here:

http://www.marooned.org.uk/~arno/python/lexing.html

It's not extremely sophisticated but it's quite easy to use. I've
written a Python 3 tokeniser in it :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,190
Latest member
Martindap

Latest Threads

Top