Python_day_07_文件操作

三目运算(三元运算) a = 3 b =2 val = a if a>b else b 文件读取 f = open(file = 'd:/MyPythonStudy/test.txt', mode = 'r', encoding= 'utf8') data =f.read() f.close encodeing= “编码方式” :: 保证和原文件编码方式 不知道文件编码方式时:
相关文章
相关标签/搜索