Re: printing inside and outside of main() module
- From: Bruno Desthuilliers <bruno.42.desthuilliers@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 30 Apr 2008 18:14:06 +0200
Peter Otten a écrit :
korean_dave wrote:
This allows me to see output:main() # add this
---begin of try.py
print "Hello World"
--end of try.py
This DOESN'T though...
--begin of try2.py
def main():
return "Hello"
--end of try2.py
Can someone explain why???
Python doesn't call the main() function; you have to invoke it explicitly.
<OP>
And while we're at it, your main function *returns* a value, but doesn't *print* anything.
</OP>
.
- Follow-Ups:
- Re: printing inside and outside of main() module
- From: Peter Otten
- Re: printing inside and outside of main() module
- References:
- printing inside and outside of main() module
- From: korean_dave
- Re: printing inside and outside of main() module
- From: Peter Otten
- printing inside and outside of main() module
- Prev by Date: Re: Colors for Rows
- Next by Date: Re: printing inside and outside of main() module
- Previous by thread: Re: printing inside and outside of main() module
- Next by thread: Re: printing inside and outside of main() module
- Index(es):