]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Adapt it to modern times (0.9.6)
authorGuido van Rossum <guido@python.org>
Mon, 30 Mar 1992 11:01:26 +0000 (11:01 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 30 Mar 1992 11:01:26 +0000 (11:01 +0000)
Demo/stdwin/python.py

index bb853169a58cf60bcd35429fb257c39b21e6254a..e987eeec03420b7e4e0e40fc4a074e635ff8cf13 100755 (executable)
@@ -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)
                #