I am working on a project where I will need to potentially open and read a textfile either on a local server or remotely (via url). Is there a python function that works like php's :
file_get_contents()
that can do this? right now I have:
def get_data_from_file(path):
for i, line in enumerate(open(path)):
.....
I would like to pass in a path either locally or remotely.