Input and Output File Operations in Python