''' Input: 192.168.0.1 192.168.0.2 192.168.0.3 Output: ['192.168.0.1','192.168.0.2','192.168.0.3'] ''' with open('list.txt', 'r') as file: data = file.read().splitlines() print(data)