reading and writing files indicates that the offset is relative to start of file (the default means that the offset is relative to the current pointer position indicates the offset is relative to end of file thuswe can move the pointer to position relative to the start of the fileto the end of the fileor to the current position for examplein the following sample code we create new text file and write set of characters into that file at this point the pointer is positioned after the 'zin the file howeverwe then use seek(to move the point to the th character in the file and now write 'hello'next we reposition the pointer to the th character in the file and write out 'boowe then close the file finallywe read all the lines from the file using with as statement and the open(function and from this we will see that the text is the file is now abcdefboojhellopqrstuvwxyzf open('text txt'' ' write('abcdefghijklmnopqrstuvwxyz\ ' seek( , write('hello' seek( write ('boo' close(with open('text txt'' 'as ffor line in fprint(lineend='' directories both unix like systems and windows operating systems are hierarchical structures comprising directories and files the os module has several functions that can help with creatingremoving and altering directories these includemkdir(this function is used to create directoryit takes the name of the directory to create as parameter if the directory already exists fileexistserror is raised chdir(this function can be used to change the current working directory this is the directory that the application will read fromwrite to by default getcwd(this function returns string representing the name of the current working directory rmdir(this function is used to removedelete directory it takes the name of the directory to delete as parameter listdir(this function returns list containing the names of the entries in the directory specified as parameter to the function (if no name is given the current directory is used