常规文件读取方法
file1 = open("c:/Users/lenovo/Desktop/命令.txt",encoding='utf_8')
data = file1.read()
print(data)
file1.close()
通过with关键字读取文件
with open("c:/Users/lenovo/Desktop/命令.txt",encoding='utf_8') as file1:
data=file1.read()
print(data)

常规文件读取方法
file1 = open("c:/Users/lenovo/Desktop/命令.txt",encoding='utf_8')
data = file1.read()
print(data)
file1.close()
通过with关键字读取文件
with open("c:/Users/lenovo/Desktop/命令.txt",encoding='utf_8') as file1:
data=file1.read()
print(data)