Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # void_io_newline_esc.py
- # List_of_Values.txt file with the following in it --
- '''
- Value1
- Value2
- Value3
- Value4
- '''
- # Code showing newline after each value...
- '''
- t = open('List_of_Values.txt', 'r+w')
- contents = t.readline()
- mylist = []
- for i in contents:
- mylist.append(i)
- '''
- # output >>> ['Value1\n', 'Value2\n', ...] but, considering the \n is not needed...
- mylist = open(List_of_Values.txt).read().splitlines()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement