This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bob.ippolito
Recipients
Date 2004-02-26.17:43:24
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=139309

I don't agree with either of your advantages.
- bundlebuilder could compile the "main code" as-is, it just doesn't
- never has to be moved, in exchange for importing foo.bar as 
__main__?  No thanks.

"executable" is for something else.  "mainprogram" is exactly what it 
says it is, it's a program, not a module-inside-a-package-that-should-be-
imported-as-__main__.  Perhaps there could be a 
"writemeamainprogram" argument where you would specify something 
like "foo.bar:main" where foo.bar is the module and main is the 
function.. but then how would you decide which idiom it should be called 
with (sys.argv[1:], sys.argv, no arguments, etc.).

It's not hard to make a two-line program that does what you need it to 
and use that as the mainprogram.. I think this use case is just too 
specific to the style of your single application.  I *always* see the 
separate-main-program idiom used that imports something and calls 
some function, I have *never* seen people symlink something in /usr/
local/bin to something in site-packages.
History
Date User Action Args
2008-01-20 09:59:34adminlinkissue900514 messages
2008-01-20 09:59:34admincreate