Re: printing inside and outside of main() module
- From: Peter Otten <__peter__@xxxxxx>
- Date: Wed, 30 Apr 2008 18:18:03 +0200
Bruno Desthuilliers wrote:
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>
Ouch!
.
- References:
- printing inside and outside of main() module
- From: korean_dave
- Re: printing inside and outside of main() module
- From: Peter Otten
- Re: printing inside and outside of main() module
- From: Bruno Desthuilliers
- printing inside and outside of main() module
- Prev by Date: Re: printing inside and outside of main() module
- Next by Date: Re: Sending Cntrl-C ??
- Previous by thread: Re: printing inside and outside of main() module
- Index(es):
Relevant Pages
|