Python open file text and read file content

def read_text():

print("open file text!")

file_text = open("/Users/Yan/Desktop/hello.text")

file_content = file_text.read()

print(file_content)

read_text()

Python open file text and read file content_第1张图片
Python open file text and read file content.png

你可能感兴趣的:(Python open file text and read file content)