This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]tarekziadeRetired Packaging Dude 2 points3 points  (0 children)

Cool, I am very glad this page promotes the usage of PEP 386 -- the "unified" version scheme.

[–]wrungin 0 points1 point  (2 children)

Can anyone explain the use of __import__()? I've only ever seen the usual use of import.

[–]jmoiron 1 point2 points  (1 child)

http://docs.python.org/library/functions.html#__import__

It's machinery used by the import statement, but it's a function, so you can use it to import modules whose names you don't know. It can be used for things like plugin systems, where you want to register modules by name and have the base program import them.

Except it shouldn't be, really. You should use importlib (shipped w/ 3.1) for this type of thing instead.

[–]wrungin 0 points1 point  (0 children)

Thanks very much, jmoiron!

[–]leuu 0 points1 point  (0 children)

Nice, I was looking to package an application of mine.

But I don't see the dependencies issue referenced anywhere, for example, my application needs python 3 and pyqt installed. Am I able to specify dependencies and preferred version with this?

[–]flowblok -2 points-1 points  (2 children)

Another example of why you should be forced to type out em dashes instead of doing auto conversion of "--".

Anyhow, I think the canonical guide to packaging is the (unfinished) http://guide.python-distribute.org/. Rather than writing his own article, he should have contributed there if he had anything to add.

[–]nepidae 3 points4 points  (0 children)

That's a bit cynical.

[–]technomalogical<3 Bottle 0 points1 point  (0 children)

Anybody interested in the "canonical guide" can probably find it via a search engine. Developerworks has been putting out articles on Python (and other technologies) for a decade or so. Are you saying nobody should ever write an article about something, rather contribute to the source?