Python4Kids: New Tutorial: Filing
Oct 01, 2010, 20:02 (0 Talkback[s])
(Other stories by Brendan Scott)
How to Help Your Business Become an AI Early Adopter
[ Thanks to Brendan Scott for this
"We come now to a crossroads. We can't keep typing all
the questions in each time. That would be too tedious! So, we're
going to look at one way of "persisting" data. That is, storing
data from one session so that you can use it in another session.
We're not going to cover the way of storing Python objects (since
we haven't really looked at objects yet), rather, we're going to do
some filing – with files on the filesystem. This makes use of
the open() function."
>>> import os.path
>>> nameOfFile ='python4kidsTest.txt'
>>> # just a test filename
... # check to see if the file is there