[Tutor] I NEED HELP!!!

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Sun, 18 Nov 2001 22:19:37 -0800 (PST)


On Sun, 18 Nov 2001, Jaela Gulamhusein wrote:

> I need to do a program for school, we have to use Prim's Algorithm to
> sort an input file and then create a minimum spanning tree and then do
> a depth first traversal to output it.  I just started python a couple
> weeks ago and am not familiar with what I can do with it.  Also, the
> input file contains matrices, the comparison of them and the
> difference between them becomes the weight of the each edge on the
> tree.  I can probably do the algorithm and the traversal but I'm
> really confused on how to read the input file in.  Any help you could
> give me would be great.

Hi Jaela,

Since you're doing computer science, I'm assuming you already know another
programming language like C, Pascal, or Java.  If so, then you can
transfer a lot of what you know already toward Python.  One of the the
fastest way to get to speed with Python is to go through the Python
Tutorial, located here:

    http://python.org/doc/current/tut/tut.html

With it, you should be able to read through it with, interpreter in hand,
and start speaking halting pidgin Python.  *grin*

The section on reading files is Section 7:

http://python.org/doc/current/tut/node9.html#SECTION009200000000000000000

When you have any questions, please feel free to ask here on Tutor.  As a
caveat: we can't help too much on core CS topics like Prim's algorithm
since that's schoolwork, but we'd be happy to help you feel familiar with
the Python language.

Best of wishes to you!