CS 1301 Recitation 7 10_6

CS 1301 Recitation 7 10_6 - os.path.isdir(path) returns...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
>>> f = open("numbers.txt", "r") >>> f.read() >>> f.readline() >>> f.readlines() read and readline will return strings readlines will return array >>> aFile = open("blankfile.txt","w") >>> aFile.write("apple") >>> aFile.write("peach") >>> aFile.write("orange") >>> aFile.close() >>> aFile = open("blank.txt", "w") >>> aFile.write("apple \n") >>> aFile.write("peach \n") >>> aFile.close()
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: os.path.isdir(path) returns TRUE and FALSE. True if there is a directory in that path named that. False if there isnt. os.listdir(path) returns list containing the names of the entries in the directory given by its path. os.path.join(path1[,path2[,]]) concatenates 2+ screen inputs and validates them as a directory...
View Full Document

This note was uploaded on 02/16/2012 for the course CS 1301 taught by Professor Staff during the Fall '08 term at Georgia Institute of Technology.

Ask a homework question - tutors are online