f = open("test.txt", 'r') variable = f.readline(1) print(variable)

Read more of this post