This article discussed how to read and write data to a file from a Python program.
这篇文章讨论了在Python程序中如何从文件读取数据和写入数据到文件中。
The program in Listing 3 shows how to do that in Python: the code takes a tar filename as a command-line argument and then prompts the user with several options.
清单3中的程序说明了如何在Python中完成这项工作:这段代码接受一个tar文件的名称作为命令行参数,然后向用户提供几种选择。
Now, Listing 3 shows how to read this data into a Python program and parse the contents of the file.
现在,清单3显示如何把这个数据读入Python程序,并解析文件的内容。
应用推荐