scanf in python...?
Terry Reedy
tjreedy at udel.edu
Wed Oct 18 00:20:50 EDT 2000
More information about the Python-list mailing list
Wed Oct 18 00:20:50 EDT 2000
- Previous message (by thread): scanf in python...?
- Next message (by thread): scanf in python...?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Tony Waterman" <tonyw54 at home.com> wrote in message > Does python have any way to mimic scanf ? I just bought Python on > Win32 and I can't find anything in there about it, or on the > python.org html tutorial. Also; how many ways to mimic scanf are > there? xscanf(x, format, pointer1, pointer2, .... pointern) is not directly possible in Python because Python does not have pointers. However, it would be possible to write a scan(string,format) function that would return a tuple of values. Since Python uses C formats for the % operator, it would add a nice symmetry. [IE, scan(format%tuple,format) == tuple]. It might be possible to do this by replacing the %format specifiers by the corresponding re specifiers and using re behind the scenes. Or by using openly available scanf code. Terry J. Reedy
- Previous message (by thread): scanf in python...?
- Next message (by thread): scanf in python...?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list