python reference file code example Example: how to reference a file in python with open("filename.txt","r") as f: contents = f.read()