new to python

Martijn Faassen m.faassen at vet.uu.nl
Tue Jun 26 13:30:03 CEST 2001


Beebe <jonbeebe at softhome.net> wrote:
> Hello comp.lang.python,

>  I am a Linux User and I am new to Python Programming and this
> newsgroup. I don't really know what python is all about so it would be
> much appreciated if you would answer my following questions.

> - Is python like c/c++ where you can make pretty much any kind of
> program you want whether is be games, gui apps, etc. or is it like cgi
> where you can only use it in websites?

You can make whatever you like in Python. One advantage you to have
with C and C++ code is that this can be compiled with an optimizing
compiler, while Python is interpreted. This means that while it is definitely
easier to write software in Python, it's somewhat easier to make your
C/C++ code run really fast. If speed is no such primary concern Python
is fine, however, and please do note that there's a _lot_ you can do
to improve the speed of a Python program (including moving little speed
critical parts to C or C++ extension modules).

For many types of application you'd like to develop you need a
set of extra libraries that enable Python to do something new.
For instance, if you want to program GUIs, you could install PyQT if
you want to use the QT library, or PyGTK for GTK GUIs. Tcl/Tk is
needed if you want a cross-platform Tk based GUI (the library you
need is Tkinter). Then there's PyWX for the wxWindows interface; there
are bindings for FOX and many other GUI libraries as well.

For games, check out www.pygame.org.

- Is python object oriented?

For most definitions of object oriented, sure. There's objects,
classes, inheritance, polymorphism, and even more important, 
dynamic type checking.

> - Should I develop in Python?

No! The PSU will come for you if you do. :) Seriously, I don't know you and you
haven't made it clear what exactly you want to do with it, so I
can't really say. :) I just can say it's easy to learn, powerful,
and many people like it, including myself.

> Is it good for programming,

It's a programming language; any programming
language makes the claim it's good for programming. :)

> is it powerfull

Any programming language makes this claim too. Depends on what powers
you'd like to have. To a great extent programming languages tend
to give you the same set of powers; it's just some powers are easier
to use in some languages than in others.

> and are job opportunities good for Python developers?

If you want good job opportunities, learn Java. :) If you learn Python
you might have to look a bit harder to find an interesting job, but
this depends on where you are and what kind of job you want.

> - When I make a Python program, do I just leave it as a .py file or is
> there a way to make it into some kind of executable file like in C++?

Usually we leave them as a bunch of .py modules, but there are tricks
to pack them up together with the Python interpreter so it'll be stand
alone. Since you're on Linux and you might very well be creating in-house
or open source software, there is usually no good reason to do that.

> When I make a program in Python, how do I distribute it out to people?
> Do I just send out the .py file?

Usually your program will consist of a bunch of .py files, so you'd
send those, together with any supporting files your program
may need (packed up in a tar.gz file is the usual thing to do
in Linux). On Linux most distributions come with packages for the
Python interpreter; some even install Python by default (such as
Red Hat).

> Does the user need some kind of runtime environment or something? 

Yes, the Python interpreter and the standard libraries.
Note that the same is true for most languages; virtually all C programs need
a bunch of supporting libraries as well to work, for instance. Of course,
most operating systems provide this library by default, so you don't
have to manually install it.

> Do they need to download something else rather than my program?

A Python installation if this doesn't come with their distribution.

Good luck,

Martijn
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list