ফাইল পড়া
file_to_work = open("Test.txt", "r")
content = file_to_work.read()
print(content)
file_to_work.close()Hello World!!!
This is second line in the file.
This is third one.file_to_work = open("Test.txt", "r")
just_one_character = file_to_work.read(1)
print(just_one_character)
remaining_four_characters = file_to_work.read(4)
print(remaining_four_characters)
rest_of_the_file = file_to_work.read()
print(rest_of_the_file)
file_to_work.close()Last updated