unit-ivfile handling filestypes of filescreating and reading text datafile methods to read and write datareading and writing binary filesthe pickle modulereading and writing csv filespython os and os path modules filesa file is location on disk that stores related information and has name there are different kinds of file such as music filesvideo filestext files python gives easy ways to manipulate these files generally we divide files in two categoriestext file and binary file text files are simple text where as the binary files contain binary data which is only readable by computer file input/output operations open file close file read file write file creating and reading of text datato read and write to text file ,we must open it )opening filesyntaxfilepointer=open(filename,modefilename can be text file with extensiontxtmodes"rread opens file for readingerror if the file does not exist "aappend opens file for appending "wwrite opens file for writing/overwriting "xcreate creates the specified filereturns an error if the file exists exf=open("demo txt",' ' =open("demo txt",' ' =open("demo txt",' ' )close filesyntaxfilepointer close(exf=open('demo txt',' 'bv prasanthi,dept of cse page