批量添加http前缀

 
f = open("foo.txt")  # 返回一个文件对象
line = f.readline()  # 调用文件的 readline()方法
while line:
    a='http://'+line

    print(a, end = '')
    line = f.readline()
    with open('result.txt',"a+") as s:
        s.write(a)


f.close()

 

 
posted @ 2020-11-21 14:30  si1encely  阅读(345)  评论(0)    收藏  举报