What is Python?!
roy at panix.com
Wed Aug 10 14:04:17 CEST 2005
Robert Wierschke <wierob at gmx.de> wrote:
> a scripting language or a "normal" language like C++ etc.
It is difficult to define exactly what a "scripting language" is and isn't,
but I think most people would classify it as a scripting language.
> So please tell me what python is, what are it's strength, what is it
> good for and when should I use it and not one of the other languages.
I think it's biggest strengths are that it's easy to learn and easy to use.
There is no separate compile stage, so testing things out is quick and
easy. The language does compile to byte code (just like Java does), but
unlike Java, the compile stage happens completely automatically. You just
run your program, and the system figures out if it needs to compile (or
re-compile) your source for you.
The ability to fire up an interactive session is key. If I'm unsure of
something, it's usually faster to just run python and try something out
(or, use the built-in help system, or use dir() to get a listing of all of
an objects methods) than to look in the manual. If your interpreter was
built properly, it's even got input editing and history built in via the
GNU readline library.
> What about graphic? Can I create graphical interfaces with python?
There are several GUI libraries. I don't do that kind of work, so I'll
leave it to others to explain them.
> Python is interpreted but is it compiled to something like the java byte
> code or are there other ways to prevent the user to read my code?
It is exactly like Java. In fact, it's so close, there's a system called
Jython, which lets you compile Java source to Python byte code. Yes, this
means it will always be possible for users to re-create your source code
from the byte-code object files you ship. How much of an issue this is to
you is a business decision.
More information about the Python-list