Reading in strings -> numbers ??
Louis M. Pecora
pecora at anvil.nrl.navy.mil
Sun Apr 30 10:33:27 EDT 2000
The syntax is not equivalent in the same sense as printf vs. scanf, but
re module will you to parse out substrings from whatever text file
you are trying to read, and then eval() can be used on the components
result, to turn the "fields" that are numeric strings into Python
Checked out the re.py module and for me it's not transparent (I've been
at Python for on ly 3 weeks, sorry). Would you or anyone have any
examples of doing what you suggest to read in numbers? Thanks.
More information about the Python-list