File read rules in python-13


#File read/write er torika
"""
"r"-open file for only reading -default
"w"-open filefor only writing
"x"-create file if not exist
"t"-text mode -default
"b"-binary mode
"+"-read and write
"""
"""
#Now lets open our created file
f=open("munna.txt" ) #file khulle off o korte hoi
#print(f.read()) or
vetorermal=f.read()
print(vetorermal)
f.close()

f=open("munna.txt","rb" ) #binarybmood a khulbo
vetorermal=f.read()
print(vetorermal)
f.close()

f=open("munna.txt") #specific character khulte
vetorermal=f.read(3)
print(vetorermal)
f.close()
"""

#line by line print korte
"""
f=open ("munna.txt" )
for line in f:
print(line,end="") #linr by line print korle autometic space nei
f.close()
"""
"""
#readlines
print("readline functions")
f=open ("munna.txt" )
print(f.readline())
print(f.readline())

"""

#List ar moddhe dhikiye print deta
"""
f=open ("munna.txt" )
print(f.readlines())

"""




Comments

Popular posts from this blog

D WEB LINK