Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4ea570d

Browse files
committed
Adapt it to modern times (0.9.6)
1 parent 9cf8f33 commit 4ea570d

1 file changed

Lines changed: 2 additions & 13 deletions

File tree

Demo/stdwin/python.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#! /usr/local/python
22

3-
XXX This file needs some work for Python 0.9.6!!!
4-
53
# A STDWIN-based front end for the Python interpreter.
64
#
75
# This is useful if you want to avoid console I/O and instead
@@ -29,15 +27,7 @@
2927
from stdwinevents import *
3028
import rand
3129
import mainloop
32-
33-
from util import readfile # 0.9.1
34-
35-
try:
36-
import mac
37-
os = mac
38-
except NameError:
39-
import posix
40-
os = posix
30+
import os
4131

4232

4333
# Filename used to capture output from commands; change to suit your taste
@@ -213,8 +203,7 @@ def do_open(win):
213203
filename = stdwin.askfile('Open file', '', 0)
214204
win = makewindow()
215205
win.filename = filename
216-
win.editor.replace(readfile(filename)) # 0.9.1
217-
# win.editor.replace(open(filename, 'r').read()) # 0.9.2
206+
win.editor.replace(open(filename, 'r').read())
218207
win.editor.setfocus(0, 0)
219208
win.settitle(win.filename)
220209
#

0 commit comments

Comments
 (0)