📌  相关文章
📜  使用 read() 函数读取文本文件中特定长度的字符 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:03.618000             🧑  作者: Mango

代码示例1
# Program to read the specific length 
# of characters in a file using read() function
file = open("python.txt", "r")
content = file.read(20)
print(content)
file.close()