what is the equivalent of scanf in python?

Oleg Broytmann phd at phd.russ.ru
Tue Mar 14 16:43:12 CET 2000


On Tue, 14 Mar 2000, Shaun Hogan wrote:
> what is the equivalent of scanf in python?

   There is no direct scanf in Python - you should implement your own
parsing of input. Example:

line = sys.stdin.readline()
x, y = string.split(line[:-1])
x, y = int(x), int(y)

Oleg.
---- 
    Oleg Broytmann      Foundation for Effective Policies      phd at phd.russ.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list