how to get first line of what is sent python code example Example: get first line of file python with open('myfile.txt') as f: first_line = f.readline()