abbarnes icon

Read URL File

abbarnes | PRO | 03/20/18 08:41:36 PM UTC | 0 ⭐ | 268 👁️ | Never ⏰ | []
Python |

310 B

|

None

|

0 👍

/

0 👎

import urllib.request as url
 
URL_LINK = ''
 
data = url.urlopen(URL_LINK)
data_bytes = data.read()
data_string = data_bytes.decode('utf8')
data.close()
 
def generate_line_list(multi_line_string):
    '''Input: multi-line string.  Output: a list of each line in the string.'''
    return data_string.split('\n')

Comments