[Edu-sig] Python @ Education: What are your problems?
Guido van Rossum
Thu, 30 May 2002 11:48:18 -0400
> In the handbook we insist they use the Shell only once (for the
> ``hello world'' program). Perhaps we should have them use it for a
> little longer.
The standard tutorial uses the Python shell extensively, to show how
various language constructs work. Maybe you can borrow from there.
> Interestingly, the experienced UNIX users and more advanced
> programmers (not generally the same people as very few students come
> knowing, for example, C, but Visual Basic is common), do tend to use
> the Shell more when debugging the more substantial problems.
Makes sense -- interactive debugging is a very powerful tool.
> > Maybe we should add a file method
> > f.printf("format string", args)
> How about a file method f.print(arbitrary comma separated variables)
> that works in the same way as print?
Alas, print is a keyword and can't be reused as a method name.
> > and a built-in function
> > printf("format string", args)
> > and deprecate the print statement???
> Deprecating the print statement is, I think, an unecessarily big change
> to the language. This trivial method of writing, that does all sorts of
> voodoo to format intelligently is one of Python's strongest features.
Ah, I must've suffered from temporary memory loss! In Python 2.0 and
later you can use the print statement to write to a file, using
print >>f, var, var, ...
So forget about my suggestion of adding printf().
--Guido van Rossum (home page: http://www.python.org/~guido/)