file handling in python introduction python has several functions for creatingreadingupdatingand deleting files the key function for working with files in python is the open(function the open(function takes two parametersfilenameand mode there are four different methods (modesfor opening file"xcreate creates the specified filereturns an error if the file exists "wwrite opens file for writingcreates the file if it does not exist "rread default value opens file for readingerror if the file does not exist "aappend opens file for appendingcreates the file if it does not exist in addition you can specify if the file should be handled as binary or text mode "ttext default value text mode "bbinary binary mode ( images write data to file to create new file in pythonuse the open(methodwith one of the following parameters"xcreate creates the specified filereturns an error if the file exists "wwrite opens file for writingcreates the file if it does not exist "aappend opens file for appendingcreates the file if it does not exist