Skip to content

Instantly share code, notes, and snippets.

@wsgzao
Last active November 12, 2021 10:08
Show Gist options
  • Save wsgzao/21e729572d592902c3c2dba8ff656180 to your computer and use it in GitHub Desktop.
Save wsgzao/21e729572d592902c3c2dba8ff656180 to your computer and use it in GitHub Desktop.
py3strlist.py
'''
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment