> I didn't really know how to title the article, I thought this
> would attract the right people:
Well - you got my attention, Jeffrey, but there IS email you know:
if you address the message to me personally, it shows up in my mailer
with a little "+" to draw attention to itself, so I can deal with it
right away!
( When I saw the subject line, I thought perhaps the "Majewski Convention"
might be an adjunct to the Majewski Golf Tournament this year!
All inquiries about the Golf Tournament to my cousin, Paul Majewski
<majewski@micf.nist.gov>, to whom I'm CC-ing this message *just* to
annoy him because he once teased me because my email id *wasn't* "majewski".
I think he wants us all to be called "Bruce" too! :-)
> Steve posted several python programs awhile back, which had some
> standard convention for checking whether the program was being
> run interactively or not, and if not, did a "def main" or somesuch
> to turn on variable optimization. What were these magic few lines?
>
> Oh dear, I just realized it may be a FAQ. I'll check.
Not just a FAQ, but it's in much of the standard Python library code:
if __name__ == '__main__' :
( if you do "import module" , __name__ will be "module". If you
do "/usr/local/bin/python module" , it will be "__main__" . )
[ often followed by an "if sys.argv[1:]:" or "for arg in sys.argv[1:]:" ]
It's Guido's invention/convention -
I merely whined for some such feature until he gave in. :-)
Actually, back when I used to have time to play bridge, I think the
"Majewski Convention" was typically described as "bidding 6 no trump
when you realling *meant* 6 hearts!" ;-)
---| Steven D. Majewski (804-982-0831) <sdm7g@Virginia.EDU> |---
---| Computer Systems Engineer University of Virginia |---
---| Department of Molecular Physiology and Biological Physics |---
---| Box 449 Health Science Center Charlottesville,VA 22908 |---