import xlrd
import re
def filetest1():
with open('file/akko') as file_object:
# with open('D:test/test.txt') as file_object:
# 绝对路径
# print(type(file_object.read().rstrip())) #read到文件末尾时会返回一个空字符串 这个空字符串打印出来显示空行
obj1 = file_object.read().rsplit() # 空格切片
for i in obj1:
print(i)
# print(file_object.read().rstrip()) #不显示空行
def filetest2():
with open('file/akko') as file_object:
str = ''
obj2 = file_object.readlines();
for line in obj2:
print(line)
str+=line.rstrip()
print(str)
def wirtefile1():
filenamme='file/akko1.txt'
with open(filenamme,'w') as file_obj:
file_obj.write("test1ntest2ntest3")
def writefile2():
filenamme = 'file/akko1.txt'
with open(filenamme, 'a') as file_obj:
file_obj.write("测试附加1n测试附加2")
def exceltes