In message <[EMAIL PROTECTED]>, AMD wrote:

Actually it is quite common, it is used for processing of files not for
reading parameters. You can use it whenever you need to read a simple
csv file or fixed format file which contains many lines with several
fields per line.

I do that all the time, in Python and C++, but I've never felt the need for
a scanf-type function.

I agree scanf is not a must have function but rather a nice to have function.

For reading delimited fields in Python, you can use .split string method.
Yes, that is what I use right now, but I still have to do the conversion to integers, floats, dates as several separate steps. What is nice about the scanf function is that it is all done on the same step. Exactly like when you use % to format a string and you pass it a dictionary, it does all the conversions to string for you.

Cheers,

André
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to