diff options
author | Guido van Rossum <guido@python.org> | 1992-03-30 11:01:26 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-03-30 11:01:26 (GMT) |
commit | 4ea570d97245c0580743a8d1e7ea351cf2c1f459 (patch) | |
tree | e6caefe04b2942d58b68e157875d593f6960ed57 /Demo | |
parent | 9cf8f3372c3b7896b085e590c1a11373b58695fb (diff) | |
download | cpython-4ea570d97245c0580743a8d1e7ea351cf2c1f459.zip cpython-4ea570d97245c0580743a8d1e7ea351cf2c1f459.tar.gz cpython-4ea570d97245c0580743a8d1e7ea351cf2c1f459.tar.bz2 |
Adapt it to modern times (0.9.6)
Diffstat (limited to 'Demo')
-rwxr-xr-x | Demo/stdwin/python.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/Demo/stdwin/python.py b/Demo/stdwin/python.py index bb85316..e987eee 100755 --- a/Demo/stdwin/python.py +++ b/Demo/stdwin/python.py @@ -1,7 +1,5 @@ #! /usr/local/python -XXX This file needs some work for Python 0.9.6!!! - # A STDWIN-based front end for the Python interpreter. # # This is useful if you want to avoid console I/O and instead @@ -29,15 +27,7 @@ import stdwin from stdwinevents import * import rand import mainloop - -from util import readfile # 0.9.1 - -try: - import mac - os = mac -except NameError: - import posix - os = posix +import os # Filename used to capture output from commands; change to suit your taste @@ -213,8 +203,7 @@ def do_open(win): filename = stdwin.askfile('Open file', '', 0) win = makewindow() win.filename = filename - win.editor.replace(readfile(filename)) # 0.9.1 - # win.editor.replace(open(filename, 'r').read()) # 0.9.2 + win.editor.replace(open(filename, 'r').read()) win.editor.setfocus(0, 0) win.settitle(win.filename) # |