要运行本文件中的语句,您需要启动一个Python解释器,并让它去读取和处理文件的内容。
To run the statements in this file, you need to start a Python interpreter and tell it to read and process the contents of the file.
要读取数据,首先要创建合适的file对象——在这个示例中,文件对象打开testit .txt文件,并用read方法读取内容。
To read the data, you first create an appropriate file object — in this case, one that opens the testit.txt file — and read the contents using the read method.
非常棒,现在你有了一个从外部文件读取谚语的应用了,这将对日后要维护内容时提供了极大的便利。
Awesome, now you have a file that can read quotes from an external file! This can be especially handy if you want someone else to fill in some quotes for you as you continue to work on your app.
非常棒,现在你有了一个从外部文件读取谚语的应用了,这将对日后要维护内容时提供了极大的便利。
Awesome, now you have a file that can read quotes from an external file! This can be especially handy if you want someone else to fill in some quotes for you as you continue to work on your app.
应用推荐