How to Start

  • Thread starter Michael R. Copeland
  • Start date
M

Michael R. Copeland

I've decided that Python is a language/environment I'd like to learn
(I've been a professional programmer for 45+ years), but I really don't
know where and how to start! I have a number of books - and am buying
some more - but because of the bewildering number of after-market
packages, environments, and add-ons, I am really quite perplexed about
starting. 8<{{
Yes, I could fire up the interactive mode and play with some
statements...but I consider that sort of thing for programming neophytes
or experimenting with specific issues. First, I want to develop a
simple Windows application, and because of the plethora of "stuff" the
Python world offers, I don't know where to begin.
For example, what basic, easy-to-use interface might I start with to
build a simple text file parsing and analysis program? That is, I'd
like to start with a simple Windows shell that prompts for a file name,
processes it, and then displays some result.
I am certainly impressed with the apparent experience and openness of
the regular players here, but the discussions here (and in
c.l.p.announce) truly presume knowledge and experience with Python I
don't yet have. Yes, for even a very experienced programmer, entering
the Python world is very daunting - but I want to get started.
Please advise. TIA
 
T

TheFlyingDutchman

I've decided that Python is a language/environment I'd like to learn
(I've been a professional programmer for 45+ years), but I really don't
know where and how to start! I have a number of books - and am buying
some more - but because of the bewildering number of after-market
packages, environments, and add-ons, I am really quite perplexed about
starting. 8<{{
Yes, I could fire up the interactive mode and play with some
statements...but I consider that sort of thing for programming neophytes
or experimenting with specific issues. First, I want to develop a
simple Windows application, and because of the plethora of "stuff" the
Python world offers, I don't know where to begin.
For example, what basic, easy-to-use interface might I start with to
build a simple text file parsing and analysis program? That is, I'd
like to start with a simple Windows shell that prompts for a file name,
processes it, and then displays some result.
I am certainly impressed with the apparent experience and openness of
the regular players here, but the discussions here (and in
c.l.p.announce) truly presume knowledge and experience with Python I
don't yet have. Yes, for even a very experienced programmer, entering
the Python world is very daunting - but I want to get started.
Please advise. TIA

I like Wing IDE ( http://www.wingware.com ) . They have a free version
and Personal and Professional versions.

The free version description says:
"Wing IDE 101

Wing IDE 101 is a free basic edition of Wing IDE that was originally
designed with the University of Toronto Computer Science Department
for teaching entry level computer science courses. It is not open
source but is free for use by educators, students, and hobbyists.

Note that Wing IDE 101 omits auto-completion and most other code
intelligence features in the other Wing IDE products. This was by
design, so that students are more conscious of the details of the
language and modules they are learning about."
 
T

Tom Brown

I've decided that Python is a language/environment I'd like to learn
(I've been a professional programmer for 45+ years), but I really don't
know where and how to start! I have a number of books - and am buying
some more - but because of the bewildering number of after-market
packages, environments, and add-ons, I am really quite perplexed about
starting. 8<{{
Yes, I could fire up the interactive mode and play with some
statements...but I consider that sort of thing for programming neophytes
or experimenting with specific issues. First, I want to develop a
simple Windows application, and because of the plethora of "stuff" the
Python world offers, I don't know where to begin.
For example, what basic, easy-to-use interface might I start with to
build a simple text file parsing and analysis program? That is, I'd
like to start with a simple Windows shell that prompts for a file name,
processes it, and then displays some result.
I am certainly impressed with the apparent experience and openness of
the regular players here, but the discussions here (and in
c.l.p.announce) truly presume knowledge and experience with Python I
don't yet have. Yes, for even a very experienced programmer, entering
the Python world is very daunting - but I want to get started.
Please advise. TIA

A good book, a link to the module index, a good text editor and a command
prompt will get you started. Sounds like you have some books. Those should
help a lot. A good text editor is a matter of taste. I prefer gvim. However,
gvim has a steep learning curve to become productive. There is eric4, which
is an IDE. I has a debugger. That may be the place to start.

Good luck,
Tom
 
B

Brandon Barry

I've decided that Python is a language/environment I'd like to learn
(I've been a professional programmer for 45+ years), but I really don't
know where and how to start! I have a number of books - and am buying
some more - but because of the bewildering number of after-market
packages, environments, and add-ons, I am really quite perplexed about
starting. 8<{{
Yes, I could fire up the interactive mode and play with some
statements...but I consider that sort of thing for programming neophytes
or experimenting with specific issues. First, I want to develop a
simple Windows application, and because of the plethora of "stuff" the
Python world offers, I don't know where to begin.
For example, what basic, easy-to-use interface might I start with to
build a simple text file parsing and analysis program? That is, I'd
like to start with a simple Windows shell that prompts for a file name,
processes it, and then displays some result.
I am certainly impressed with the apparent experience and openness of
the regular players here, but the discussions here (and in
c.l.p.announce) truly presume knowledge and experience with Python I
don't yet have. Yes, for even a very experienced programmer, entering
the Python world is very daunting - but I want to get started.
Please advise. TIA

Michael,

I suggest starting with Python's core documentation. Its rather well
written and contains many examples. If nothing else, a thorough
review of the Library reference may help you evaluate the
"after-market packages, environments, and add-ons" you describe.

http://docs.python.org/tut/tut.html (Tutorial)
http://docs.python.org/lib/lib.html (Library Reference)
http://docs.python.org/ref/ref.html (Language Reference)

The simple text parsing and analysis program you are considering seems
unlikely to require either "Extending and Embedding" or the Python/C
API, but if you find yourself drawn to either topic I again suggest
starting with the core documentation.

http://docs.python.org/ext/ext.html (Extending and Embedding)
http://docs.python.org/api/api.html (Python/C API)

You may also find it useful to examine others' programs. The Python
Package Index and ActiveState's Python Cookbook are both excellent
resources.

http://cheeseshop.python.org/pypi (Package Index)
http://aspn.activestate.com/ASPN/Python/Cookbook/

Every new Python user should read David Goodger's "Idiomatic Python"
tutorial.

http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html

I've benefited greatly from HOWTOs available at A.M. Kuchling's
website.

http://www.amk.ca/python/howto/

Be sure to consider the optparse and cmd modules if you decide to
develop the simple shell you've described.

I hope this helps,
Brandon
 
N

Nikita the Spider

I've decided that Python is a language/environment I'd like to learn
(I've been a professional programmer for 45+ years), but I really don't
know where and how to start! I have a number of books - and am buying
some more - but because of the bewildering number of after-market
packages, environments, and add-ons, I am really quite perplexed about
starting. 8<{{
For example, what basic, easy-to-use interface might I start with to
build a simple text file parsing and analysis program? That is, I'd
like to start with a simple Windows shell that prompts for a file name,
processes it, and then displays some result.

Hi Michael
I am a relative newbie to the field having only been in front of a
keyboard for about half as long as you. I've been using Python for a
couple of years now and I like it. My $.02 for someone such as yourself
is to deal with Python and as little else as possible. So write your
code in a simple text editor like UltraEdit or Notepad if you're
hardcore or edlin if you're really trying to impress someone (does that
still ship with Windows?) and run your program from the command line by
typing 'python MyProgram.py'. Once you're more familiar with the
language you can graduate to fancier tools but you will take with you a
fundamental understanding of what Python needs/gives and what the IDE
needs/gives.

I think writing code is a great way to learn a language, so it sounds
like you've already got some incentive there. Dive into Python is a
popular reference. (It's free online.)

I'm sure you'll get other good suggestions from this group.

Have fun!
 
J

James Stroud

Michael said:
Yes, I could fire up the interactive mode and play with some
statements...but I consider that sort of thing for programming neophytes
or experimenting with specific issues.

The interactive interpreter is *the fastest* way to learn, expert,
novice, or somewhere in-between. Let me do a quick count of the number
of instances I have running just on the machine I'm at right now...ok,
only 1, but that's because I just switched over to a Mac at work and it
doesn't support multiple desktops--yet. I basically test just about
every idea I have in the interactive interpreter before I lay it down in
a text file.

First, I want to develop a
simple Windows application, and because of the plethora of "stuff" the
Python world offers, I don't know where to begin.

Pseudocode (~ python code).
For example, what basic, easy-to-use interface might I start with to
build a simple text file parsing and analysis program? That is, I'd
like to start with a simple Windows shell that prompts for a file name,
processes it, and then displays some result.

#! /usr/bin/env python

def main():
file_name = prompt_for_name()
result = process(file_name)
display(result)

def prompt_for_name():
[fill in here]

[etc.]
I am certainly impressed with the apparent experience and openness of
the regular players here, but the discussions here (and in
c.l.p.announce) truly presume knowledge and experience with Python I
don't yet have. Yes, for even a very experienced programmer, entering
the Python world is very daunting - but I want to get started.
Please advise. TIA

Here's your recipe:

1. begin coding until you hit a wall
2. read official tutorial until you figure out a solution
3. experiment in interactive interpreter
4. goto 1.

I know this sounds obvious, but its the best way to jumpstart.

James
 
P

Paul McGuire

Yes, I could fire up the interactive mode and play with some
statements...but I consider that sort of thing for programming
neophytes or experimenting with specific issues.

To misquote Francis Bacon, "you would have fish, but dare not get your
fingernails dirty."

Back in '62-minus, when you started programming, there was no such
thing as "just dive in and try stuff." Imagine if someone had said,
"Just punch some random holes in this computer card and feed it in -
you'll get the hang of it," you would have thought they were crazy.
So you probably read a whole bunch of books first, before you punched
your very first card, and then stood in line to feed your deck to the
card reader on "the mainframe," then waited anywhere from 15 minutes
to an hour or more to get your job output. The length of this cycle
was itself a deterrent to interactive experimentation - you had to
*know* what you were doing and do it right, or risk wasting an hour
because you accidentally punched a character in column 6 instead of
column 7. In fact, much of the software development process from that
era was oriented around avoiding as many needless compile/run cycles
as possible.

Well, in 45+ years, things have progressed a bit. Nowadays, I don't
pore over my code looking for that stray or missing brace or closing
paren - the compiler will tell me in about 3 seconds where these
syntax errors are.

And so too with Python. Do "neophytes" just dive in and try stuff?
What of it? You have chosen a nice simple little problem space, well
within the fairway of the vanilla, batteries-included Python. In your
noobiness you might write some code that duplicates the features of a
standard built-in module, but so what? Isn't your goal to learn the
language as well as the libraries? And you would not be the first
(nor the last) to post a question to this group along the lines of
"can you look at this code and see what I'm doing wrong?" and get back
the answer of "what you're doing wrong is writing your own code
instead of just using standard module X" - it happens to many
newcomers and nearly all survive this early trauma. Just because I
can convert a list of data into a histogram in a single line of code
if I use itertools.groupby, doesn't invalidate my learning how to do
it in 4 lines with a defaultdict, or 6 lines with an explicit for
loop.

In your shoes, I would pursue a minimalist approach, learning the
basic language features, and then browsing through the standard lib
docs to get familiar with the available modules. Get a no-frills IDE
with a short learning curve - I like SciTE for this, although there is
no auto-completion - to help automate your code/run cycle (note: just
code/run, no compile step!). I also suggest you go to the Python.org
wiki and look for the documentation for experienced programmers who
are starting to switch over to Python (http://wiki.python.org/moin/
BeginnersGuide/Programmers) - others have trod this path before, and
some have left bread crumbs behind.

Best of luck!
-- Paul
 
S

Shawn Milochik

Here's your recipe:

1. begin coding until you hit a wall
2. read official tutorial until you figure out a solution
3. experiment in interactive interpreter
4. goto 1.

I know this sounds obvious, but its the best way to jumpstart.

James
--

What a beautiful way of putting it! That's what I do all the time,
although sometimes my bookshelf or Google is a stand-in for #2. I try
not to post to the list before I have working code.

You know, if you could make that process into a haiku, you could just
make that your sig and answer nearly every question that hits this
list. ^_^

I wonder whether lists like this hurt more people than they help,
because it's too easy to ask for help too soon. Those of you who
consistently give the best advice didn't learn by asking for help
every step along the way, did you? Is it really teaching a man to fish
if you bait his line and tell him where to cast?

Shawn
 
D

DouhetSukd

My $.02 for someone such as yourself
is to deal with Python and as little else as possible. So write your
code in a simple text editor like UltraEdit or Notepad

Second that opinion. Use _your_ favorite basic text editor and run on
command line. Don't clutter your attention with complex tools, yet,
Python's not J2EE for Pete's sake. I started on Kedit, but mostly use
Eclipse + pydev now, with KEdit as a backup.

Do use one of the interactive interpreters (pythonwin, python prompts,
etc...) to try out one liners and short pieces of code. But I've
never really liked them for writing full programs.

And I would just do the tutorial or Dive Into Python (http://
www.diveintopython.org/toc/index.html). If you are as experienced as
you say, you should have very little trouble working through them,
really quickly (3-4 hours?) and you'll have a good tour of the
features. I picked up Python on a Montreal to Vancouver flight, doing
just that.

For your problem domain. Modules: optparse, regular expressions.
Perhaps the "Text Processing in Python" book by Mertz. I don't like
it much myself, but it does cover text processing in depth and it
refers to a number of existing specialized libraries.

Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top