'''
Test for python file operation
'''
fp=open(file="d:/test.txt",mode='w+')
context="This is a test.\nTest 2"
fp.write(context)
fp.close()

fp=open(file="d:/test.txt",mode="r+")
content=fp.readline()
while content:
    print(content)
    content=fp.readline()
fp.close()

fp=open("d:/test.txt","r")
content=fp.readlines()
print(content)
print(type(content))
print(len(content))
fp.seek(0,0)
for line in fp:
    print(line)
fp.close()

bdb701347e951277de66ce3c2701151654128748
<mask token>

<mask token>
fp.write(context)
fp.close()
<mask token>
while content:
    print(content)
    content = fp.readline()
fp.close()
<mask token>
print(content)
print(type(content))
print(len(content))
fp.seek(0, 0)
for line in fp:
    print(line)
fp.close()

<mask token>
fp = open(file='d:/test.txt', mode='w+')
context = """This is a test.
Test 2"""
fp.write(context)
fp.close()
fp = open(file='d:/test.txt', mode='r+')
content = fp.readline()
while content:
    print(content)
    content = fp.readline()
fp.close()
fp = open('d:/test.txt', 'r')
content = fp.readlines()
print(content)
print(type(content))
print(len(content))
fp.seek(0, 0)
for line in fp:
    print(line)
fp.close()

'''
Test for python file operation
'''
fp=open(file="d:/test.txt",mode='w+')
context="This is a test.\nTest 2"
fp.write(context)
fp.close()

fp=open(file="d:/test.txt",mode="r+")
content=fp.readline()
while content:
    print(content)
    content=fp.readline()
fp.close()

fp=open("d:/test.txt","r")
content=fp.readlines()
print(content)
print(type(content))
print(len(content))
fp.seek(0,0)
for line in fp:
    print(line)
fp.close()
