Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs


Top White Papers

More on LinuxToday


Python4Kids: New Tutorial: Filing

Oct 01, 2010, 20:02 (0 Talkback[s])
(Other stories by Brendan Scott)

[ Thanks to Brendan Scott for this link. ]

"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
...

Complete Story

Related Stories: