How to read the contents of a text file?
pathlib.Path

Recommend for paths, using pathlib module.  

For the most part this is a generic python question. The blender specific part is making the path absolute if given as a blender relative path, prefixed with "//"


Relative chosen when setting path property in file browser

import bpy
from pathlib import Path


#path = some_object.filepath # as declared by props
path = "//tmp/foo/bar.txt"  # a blender relative path

f = Path(bpy.path.abspath(path)) # make a path object of abs path

if f.exists():
    print(f.read_text()) # read and print.


The site https://medium.com has some great articles on pathlib and its usage:


https://medium.com/@ageitgey/python-3-quick-tip-the-easy-way-to-deal-with-file-paths-on-windows-mac-and-linux-11a072b58d5f
https://medium.com/@webology/pathlib-is-wonderful-9d25919469d3
https://medium.com/swlh/five-most-useful-pathlib-operations-77f9c96790b3