If you mean open the file with notepad:
Using os.startfile
(only available in Windows):
import os
os.startfile(r'd:\example.txt')
Using subprocess.Popen
or subprocess.call
:
import subprocess
subprocess(['notepad', r'd:\example.txt'])
To print to console
import sys
with open(r'D:\example.txt') as f:
sys.stdout.writelines(f)
with open(r'D:\example.txt') as f:
for line in f:
print line.rstrip('\n')