When and why would I ever use
> "__main__" or the many other "__whatever__" constructs?
You don't generally use those names directly, they are 'magic'. The
__add__ example is a good one. When you do `"hello " + "world"` behind
the scenes python is actually calling "hello ".__add__("world").
There
On Jun 16, 4:56 pm, [EMAIL PROTECTED] wrote:
> After a couple of weeks studying Python, I already have a few useful
> scripts, including one that downloads 1500 Yahoo stock quotes in 6
> seconds. However, many things are puzzling to me. I keep on seeing
> things like "__main__" in scripts. A more
On Mon, Jun 16, 2008 at 5:56 PM, <[EMAIL PROTECTED]> wrote:
> After a couple of weeks studying Python, I already have a few useful
> scripts, including one that downloads 1500 Yahoo stock quotes in 6
> seconds. However, many things are puzzling to me. I keep on seeing
> things like "__main__" in s
On Jun 16, 2:56 pm, [EMAIL PROTECTED] wrote:
> After a couple of weeks studying Python, I already have a few useful
> scripts, including one that downloads 1500 Yahoo stock quotes in 6
> seconds. However, many things are puzzling to me. I keep on seeing
> things like "__main__" in scripts. A more
After a couple of weeks studying Python, I already have a few useful
scripts, including one that downloads 1500 Yahoo stock quotes in 6
seconds. However, many things are puzzling to me. I keep on seeing
things like "__main__" in scripts. A more obscure example would be
"__add__" used in string con