一枚路过的程序猿

关注

python 读取txt

一枚路过的程序猿

关注

阅读 123

2023-01-13


f=open("foo.txt")
for line in f:
print (line)

f = open("data.txt","r")   #设置文件对象
st= f.read() #将txt文件的所有内容读入到字符串str中
f.close() #将文件关闭


相关推荐

求索大伟

python 分行读取txt文件

求索大伟 199 0 0

我是芄兰

python 读取txt 逗号分隔

我是芄兰 80 0 0

三千筱夜

python 读取 写入txt文件

三千筱夜 156 0 0

四月天2021

python 读取TXT存储为列表

四月天2021 41 0 0

开源分享

【Python系列】txt文件读取操作

开源分享 35 0 0

infgrad

python读取、写入txt文本内容

infgrad 188 0 0

陆公子521

java 读取txt

陆公子521 49 0 0

草原小黄河

java读取txt

草原小黄河 87 0 0

guanguans

python读取TXT文件第二行

guanguans 59 0 0

7dcac6528821

python 读取txt 转换成json

7dcac6528821 74 0 0

精彩评论(0)

0 0 举报