Programmer-Wanna-Be (Is Python for me?)

Louis Luangkesorn lluang at northwestern.edu
Wed Oct 11 13:48:21 EDT 2000


Just so you know, I started with Python all of two weeks ago, because I
needed to use a package that is made for use in Python (NumPy, which
interfaces with LAPACK, if you are interested).  I have working programs
equal in functionality to stuff that took me much longer to write in
Matlab/Octave.  I've also used Visual Basic, some C, and once upon a time I
used Java in a class.  I'm not an expert programmer, but I can code in a
pinch, .  So, let's dive in. . .


Since you are a non-programmer, at some point you need to learn the basics of
programming.  This would include variables (like in algebra), control
statements, functions/modules/procedures/methods, data structures, and
classes.  For someone who is trying to be self-taught, Python has one
advantage of having a lot of resources available made for teaching
programming.

I would try the online book "How to think like a Computer Scientist".
<http://www.elkner.net/obp/thinkCS/thinkCSpy/index.htm> (other versions:
http://www.elkner.net/obp/thinkCS/index.html)  It was originally written in
C++ (I think) but has also been rewritten in Java and Python.  The Python
version was made because a CS teacher in Virginia wanted material to teach an
introduction to computer science course and found C++ to be bulky, since his
students were spending more time fighting the syntax of C++ as opposed to
understanding programming.  Python (I think) has an advantage of being
cleaner, in particular, when programming, there is less overhead, both in the
code and in the environment.

One reason I think that Python would be good to learn with is there is less
overhead. In particular, Python code can be read aloud and you would actually
know what it did (or at least make a pretty good guess).

fifeclub at my-deja.com wrote:

> NowI've got many questions for all of you who use Python.  (And please
> dumb things down to my current "non-programmer" level of comprehension!)
>
> 1.  First of all, is Python what I'm looking for:  a way to create
> Windows (or other OS's) applications?

Python is a scripting language, and I would answer it in the same way as I
would answer the question in Visual Basic.  what it is real good for is to
take components written in a system language (C, C++, Java) and build them
into an application, while also providing some application logic along the
way (an example of components would include the *.dll files that are in your
C:/WINDOWS directory)  Given that you already had these components or
libraries (for number crunching or graphics), Python can be what you are
looking for.

> 2.  Is Python RELATIVELY one of the easiest ways to do this?

Yes.  Two reasons.  One is that it has what I would call a clean syntax.
Everything in a Python program means what you think it means, and you don't
have to guess (or know) anything.  There are some things like the use of tabs
and spaces that you will learn, but that won't take long.  The second is
there are a lot of people who have spent time using Python to teach absolute
beginners, so there is some good introductory material available (for free!).

>
> 3.  What about Visual Basic? (the most commonly used) Why should I not
> choose VB instead?

To be honest, VB is a product that you can get results very quickly.  This
makes it real nice for building a graphical interface, . . . for a program
written in another language.  For actually getting something done, there is a
lot of overhead because of the linked libraries (underlying code that
actually does the work). Also, for some reason, every library I've ever
needed from Visual Basic was poorly documented and full of errors (and I'm
talking about commercial products).  If you don't use any libraries, your
programs

Using Python as a learning language will teach you to separate in your head
the interface and the

>
> 4.  Is there a WYSIWYG editor (like Frontpage is for HTML)?  Is this what
> Tkinter is?  Is there a 'better' WYSIWYG editor for Python that I should
> use instead?

WYSIWYG is something that matters for things that are seen by others, such as
graphics, page layout, buttons, etc.  For programming, for the most part (at
least until you get to professional tools) code is written using text
editors, (for a low featured example, Notepad)  Progammers generally like
editors that do things like syntax highlighting (identifies key words and
programming constructs) and indenting (makes it easier to understand your
code)  Python includes an Integrated Development Environment (IDE) called
IDLE, which does this for you.  IDE's can include editors,
compiler/interpreters, class browsers, etc.  When you purchase Visual
Basic/C++/Java, this is what you are purchasing.  With Python, you get a very
basic IDE, but enough to do what you need.

>
> 5.  What's the deal with Tk/Tcl?  Why is this so closely tied with Python
> and Tkinter if Python is it's own language?  (The install instructions
> say I may need to install Tk/Tcl too (what ever that is))

Tk/Tcl is a graphics toolkit and a scripting language.  What is important
hear is the Tk (toolkit) part, which has graphics libraries.  VB and Python
both cannot create graphics on their own, what they do is use a library
(those .dll files) and access the libraries to create the windows, draw
pictures, etc. (in windows, this was included unless you unchecked the box
during installation).  Tk is the graphics toolkit that comes with Python (VB
uses the Microsoft Foundation Classes, I think.  Python can also use MFC, but
that is for later)

>
> 6.  Where should I start?  (I've already downloaded and installed
> Python2.0b2 but haven't attempted to write anything)  Do I need to
> download anything else?
>

>From http://www.python.org get the IDLE documentation (to learn how to use
the tools, you already have IDLE), and the Python Tutorial (as mentioned on
the newsgroups),  Also I would start by going through "How to Think Like a
Computer Scientist"  Actually, I would do this before the tutorial, which is
really written for people who already know how to program.  For fun, you can
look at SourceForge <http://sourceforge.net> at the Code Snippets in Python,
or even Python code that is in your Python directory

If you are interested in writing more Windows applications, you should think
about the book "Python Programming in Win32", which is by O'Reilly Press.
But this is for later.

If I seem to be on the same page as you in answering your message, and if you
have more questions, feel free to email me.

Louis

> -Thanks
> -Mike
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

--
Louis Luangkesorn
lluang at northwestern.edu   http://pubweb.nwu.edu/~kll560
Who am I? They mock me, these lonely questions of mine. Whoever I am, Thou
knowest, O God, I am thine.
        - Dietrich Bonhoeffer "Who am I?"





More information about the Python-list mailing list