[Tutor] opening files (fwd)

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Wed Sep 27 02:49:02 CEST 2006


> im still pretty new to python so allmost all my programs are math stuff 
> and i would like to start writing more complex programs i know a bit 
> about functions and strings

Hi Max,

Just to clarify: you can do a lot with Python even without using files. 
Take a look at Alan Gauld's tutorial, for example.  Files come up after a 
few more of the prerequisite topics.  I guess I'm trying to say: make sure 
you've looked at some of the prerequisites.  It sounds like you're 
skipping ahead a bit.

You should feel comfortable with at least these topics:

     functions - about how they take things in (input) and what they return
                 (output), and how to use them effectively

     strings - what they are, how to manipulate them.

     sequences and loops - applying some action across a whole bunch of
                           things

Otherwise, working with files is going to be weird, because files show up 
as loopable "iterable" things that produce strings.  If you know how to 
deal with lists of strings, making the transition to files shouldn't be 
too bad.

Good luck!


More information about the Tutor mailing list