To open the file, use the built-in open() function. The open() function returns a file object, which has a read() method for reading the content of the file.
Before you read or write a file using the python built-in read/write function, you need to open the file first. open()打開檔案¶. 語法為fo = open('filename', ' ...