Well. We should face the reality. Python is a scripting
language, a Python engine built to interpret a source
code. No more, no less.
I don't know if it is more or less, but Python is a dynamic programming language, and CPython is an implementation nof it that compiles the source to a byte code, and provides an interpreter to run that that byte code (and some people call it a virtual machine).
I don't know that "scripting language" has a clear definition, nor that it confines the language to any particular use-case.
Due to that nature, the natural
way to distribute code is to distribute the Python
scripts [*]. I can even say, "to exchange code" instead
of "to distribute code".
Absolutely -- if you want to distribute (or exchange) code. However, if you want to distribute an application, it's a different story.
No different that any other language -- if you write an app or library in C, and you want to distribute/exchange code, you distribute source code.
If you want to distribute an application, you distribute one or both of:
* the source and build scripts
* compiled binaries
It's really no different with Python.
Building exe, standalone applications may be nice. Python
is basically not the appropriate tool to do this kind
of job. [**]
sure it is. Many or us do, it works fine, what's the problem?
I like what a member of this list once wrote (paraphrasing):
My clients can't tell any difference between an app written in C++ and Python -- except that the Python one has more features and fewer bugs.
So speaking of a "mess" seems to me a little bit strong.
Python has gotten wider an wider usage of the years. And many many python programs (or scripts, for that matter) depend on a variety of third-party packages. Those packages may come in different versions, and those version may not be fully compatible (backwards or forwards). Therefor, if folks are going to use the "scripting language" model, and distribute their apps as source code (scripts), then things WIL break if users want a variety of unrelated scripts to work, if they rely on different versions of the same packages.
Linux distros provide package managers to handle these issues for C/C++., etc code -- keeping track of required version sof shared libraries, etc. But Python provides no way to install two versions of a package side-by-side, so you can't use that method to manage dependencies for python scripts.
That is the "mess" I was referring to.
Fortunately, there is virtualenv and friends for the folks that distribute (and run) applications from source code, and py2exe and friends for folks that want a "binary".
The Python core developers are doing a more than
excellent job.
Of course they are -- I'm just confused as to why they have never thought this was an issue worth addressing.
When I see, that a single man can decide to rename
site-package to dist-package or some people may
decide to change the sys.getdefaultencoding(), things
can not work properly.
This is what I'm calling a mess.
part of the same issue really -- and another good reason to use a py2exe type solution to distribute applications.
> [**] I'm sometimes working in that way. I'm aware this
is not the correct way, if I'm doing this it is only for
the "fun", not for "serious" work.
what's incorrect about it-- and why not use it for serious work?
-Chris
···
On 7/29/11 2:51 AM, jmfauth wrote:
On 27 juil, 18:44, Christopher Barker<Chris.Bar...@noaa.gov> wrote:
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov