Usage of main()

r rt8396 at
Fri Sep 4 08:37:43 CEST 2009

On Sep 4, 12:55 am, Manuel Graune <manuel.gra... at> wrote:

> How come the main()-idiom is not "the standard way" of writing a
> python-program (like e.g. in C)?

Why use a nested function when you already *in* main? thats like
declaring variables when your compiler could just use some simple

'2.7' -> string because wrapped in quotes
2 -> integer because is in set{0123456789} && no quotes!
1.23 -> because all digits && has a period

...or using "{" and "}" instead of INDENT and DEDENT.

Python removes the unnecessary cruft and redundancy that is C, and
puts the burden on your machine!

> And in addition: Can someone please explain why the first version
> is so much slower?

leave that one for someone else...

More information about the Python-list mailing list