day作业

作者: 木偶演员 | 来源:发表于2018-07-26 20:59 被阅读0次
import bao
bao.fun1("./1111.txt")

bao.fun2("./1111.txt")
def fun1(url):
    with open(url, 'r', encoding='utf-8') as f1:
        file1 = f1.read()
        print(file1)
        return



def fun2(url):
    with open(url, 'rb', encoding='utf-8') as f2:
        file2 = f2.read()
        print(file2)
        return


def fun3(url,str1):
    with open(url, 'w', encoding='utf-8') as f3:
        file3 = f3.write(url,str1)
        print(file3)
        return



def fun4(url, str1):
    with open(url, 'wb', ) as f4:
        file4 = f4.write(url, str1)
        print(file4)
        return

相关文章

网友评论

      本文标题:day作业

      本文链接:https://www.haomeiwen.com/subject/shrimftx.html