cpython/Lib/lib-stdwin/filewin.py

21 lines
400 B
Python
Raw Normal View History

1990-10-13 19:23:40 +00:00
# Module 'filewin'
# File windows, a subclass of textwin (which is a subclass of gwin)
import textwin
import __builtin__
1990-10-13 19:23:40 +00:00
# FILE WINDOW
def open_readonly(fn): # Open a file window
fp = __builtin__.open(fn, 'r')
w = textwin.open_readonly(fn, fp.read())
1990-10-13 19:23:40 +00:00
w.fn = fn
return w
def open(fn): # Open a file window
fp = __builtin__.open(fn, 'r')
w = textwin.open(fn, fp.read())
1990-10-13 19:23:40 +00:00
w.fn = fn
return w