Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
f19ff1ea
Kaydet (Commit)
f19ff1ea
authored
Eki 26, 2010
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Work a bit more on tkinter demos.
üst
19208900
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
95 additions
and
86 deletions
+95
-86
attr_dialog.py
Demo/tkinter/guido/attr_dialog.py
+10
-0
manpage.py
Demo/tkinter/guido/manpage.py
+30
-35
mbox.py
Demo/tkinter/guido/mbox.py
+1
-1
mimeviewer.py
Demo/tkinter/guido/mimeviewer.py
+0
-0
shell_window.py
Demo/tkinter/guido/shell_window.py
+0
-0
sortvisu.py
Demo/tkinter/guido/sortvisu.py
+37
-37
ss1.py
Demo/tkinter/guido/ss1.py
+4
-4
tkman.py
Demo/tkinter/guido/tkman.py
+4
-4
wish.py
Demo/tkinter/guido/wish.py
+9
-5
No files found.
Demo/tkinter/guido/
AttrD
ialog.py
→
Demo/tkinter/guido/
attr_d
ialog.py
Dosyayı görüntüle @
f19ff1ea
...
...
@@ -14,6 +14,7 @@
from
tkinter
import
*
class
Option
:
varclass
=
StringVar
# May be overridden
...
...
@@ -45,6 +46,7 @@ class Option:
def
set
(
self
,
e
=
None
):
# Should be overridden
pass
class
BooleanOption
(
Option
):
varclass
=
BooleanVar
...
...
@@ -60,6 +62,7 @@ class BooleanOption(Option):
command
=
self
.
set
)
self
.
button
.
pack
(
side
=
RIGHT
)
class
EnumOption
(
Option
):
def
addoption
(
self
):
...
...
@@ -76,6 +79,7 @@ class EnumOption(Option):
value
=
v
,
command
=
self
.
set
)
class
StringOption
(
Option
):
def
addoption
(
self
):
...
...
@@ -87,6 +91,7 @@ class StringOption(Option):
self
.
entry
.
pack
(
side
=
RIGHT
,
fill
=
X
,
expand
=
1
)
self
.
entry
.
bind
(
'<Return>'
,
self
.
set
)
class
ReadonlyOption
(
Option
):
def
addoption
(
self
):
...
...
@@ -94,6 +99,7 @@ class ReadonlyOption(Option):
anchor
=
E
)
self
.
label
.
pack
(
side
=
RIGHT
)
class
Dialog
:
def
__init__
(
self
,
master
):
...
...
@@ -140,6 +146,7 @@ class Dialog:
enumoption
=
EnumOption
readonlyoption
=
ReadonlyOption
class
PackDialog
(
Dialog
):
def
__init__
(
self
,
widget
):
...
...
@@ -248,6 +255,7 @@ class RemotePackDialog(PackDialog):
class
stringoption
(
remotepackoption
,
StringOption
):
pass
class
readonlyoption
(
remotepackoption
,
ReadonlyOption
):
pass
class
WidgetDialog
(
Dialog
):
def
__init__
(
self
,
widget
):
...
...
@@ -357,6 +365,7 @@ class WidgetDialog(Dialog):
'Slider'
:
_bistate
,
}
class
RemoteWidgetDialog
(
WidgetDialog
):
def
__init__
(
self
,
master
,
app
,
widget
):
...
...
@@ -407,6 +416,7 @@ class RemoteWidgetDialog(WidgetDialog):
class
stringoption
(
remotewidgetoption
,
StringOption
):
pass
class
readonlyoption
(
remotewidgetoption
,
ReadonlyOption
):
pass
def
test
():
import
sys
root
=
Tk
()
...
...
Demo/tkinter/guido/
ManP
age.py
→
Demo/tkinter/guido/
manp
age.py
Dosyayı görüntüle @
f19ff1ea
# Widget to display a man page
import
os
import
re
import
sys
from
tkinter
import
*
from
tkinter
import
_tkinter
from
tkinter
.font
import
Font
from
tkinter.scrolledtext
import
ScrolledText
# XXX These fonts may have to be changed to match your system
BOLDFONT
=
'*-Courier-Bold-R-Normal-*-120-*'
ITALICFONT
=
'*-Courier-Medium-O-Normal-*-120-*'
# XXX Recognizing footers is system dependent
# (This one works for IRIX 5.2 and Solaris 2.2)
footerprog
=
re
.
compile
(
...
...
@@ -16,64 +15,64 @@ footerprog = re.compile(
emptyprog
=
re
.
compile
(
'^[
\t
]*
\n
'
)
ulprog
=
re
.
compile
(
'^[
\t
]*[Xv!_][Xv!_
\t
]*
\n
'
)
# Basic Man Page class -- does not disable editing
class
EditableManPage
(
ScrolledText
):
"""Basic Man Page class -- does not disable editing."""
# Initialize instance
def
__init__
(
self
,
master
=
None
,
**
cnf
):
# Initialize base class
ScrolledText
.
__init__
(
self
,
master
,
**
cnf
)
bold
=
Font
(
font
=
self
[
'font'
])
.
copy
()
bold
.
config
(
weight
=
'bold'
)
italic
=
Font
(
font
=
self
[
'font'
])
.
copy
()
italic
.
config
(
slant
=
'italic'
)
# Define tags for formatting styles
self
.
tag_config
(
'X'
,
underline
=
1
)
self
.
tag_config
(
'!'
,
font
=
BOLDFONT
)
self
.
tag_config
(
'_'
,
font
=
ITALICFONT
)
self
.
tag_config
(
'!'
,
font
=
bold
)
self
.
tag_config
(
'_'
,
font
=
italic
)
# Set state to idle
self
.
fp
=
None
self
.
lineno
=
0
# Test whether we are busy parsing a file
def
busy
(
self
):
"""Test whether we are busy parsing a file."""
return
self
.
fp
!=
None
# Ensure we're not busy
def
kill
(
self
):
"""Ensure we're not busy."""
if
self
.
busy
():
self
.
_endparser
()
# Parse a file, in the background
def
asyncparsefile
(
self
,
fp
):
"""Parse a file, in the background."""
self
.
_startparser
(
fp
)
self
.
tk
.
createfilehandler
(
fp
,
_tkinter
.
READABLE
,
self
.
tk
.
createfilehandler
(
fp
,
READABLE
,
self
.
_filehandler
)
parsefile
=
asyncparsefile
# Alias
# I/O handler used by background parsing
def
_filehandler
(
self
,
fp
,
mask
):
"""I/O handler used by background parsing."""
nextline
=
self
.
fp
.
readline
()
if
not
nextline
:
self
.
_endparser
()
return
self
.
_parseline
(
nextline
)
# Parse a file, now (cannot be aborted)
def
syncparsefile
(
self
,
fp
):
from
select
import
select
def
avail
(
fp
=
fp
,
tout
=
0.0
,
select
=
select
):
return
select
([
fp
],
[],
[],
tout
)[
0
]
height
=
self
.
getint
(
self
[
'height'
])
"""Parse a file, now (cannot be aborted)."""
self
.
_startparser
(
fp
)
while
1
:
while
True
:
nextline
=
fp
.
readline
()
if
not
nextline
:
break
self
.
_parseline
(
nextline
)
self
.
_endparser
()
# Initialize parsing from a particular file -- must not be busy
def
_startparser
(
self
,
fp
):
"""Initialize parsing from a particular file -- must not be busy."""
if
self
.
busy
():
raise
RuntimeError
(
'startparser: still busy'
)
fp
.
fileno
()
# Test for file-ness
...
...
@@ -87,22 +86,22 @@ class EditableManPage(ScrolledText):
self
.
delete
(
'1.0'
,
END
)
self
[
'state'
]
=
savestate
# End parsing -- must be busy, need not be at EOF
def
_endparser
(
self
):
"""End parsing -- must be busy, need not be at EOF."""
if
not
self
.
busy
():
raise
RuntimeError
(
'endparser: not busy'
)
if
self
.
buffer
:
self
.
_parseline
(
''
)
try
:
self
.
tk
.
deletefilehandler
(
self
.
fp
)
except
TclError
as
msg
:
except
TclError
:
pass
self
.
fp
.
close
()
self
.
fp
=
None
del
self
.
ok
,
self
.
empty
,
self
.
buffer
# Parse a single line
def
_parseline
(
self
,
nextline
):
"""Parse a single line."""
if
not
self
.
buffer
:
# Save this line -- we need one line read-ahead
self
.
buffer
=
nextline
...
...
@@ -161,8 +160,8 @@ class EditableManPage(ScrolledText):
self
.
lineno
=
self
.
lineno
+
1
self
[
'state'
]
=
savestate
# Insert a string at the end, with at most one property (tag)
def
_insert_prop
(
self
,
str
,
prop
=
' '
):
"""Insert a string at the end, with at most one property (tag)."""
here
=
self
.
index
(
AtInsert
())
self
.
insert
(
AtInsert
(),
str
)
if
TkVersion
<=
4.0
:
...
...
@@ -172,10 +171,10 @@ class EditableManPage(ScrolledText):
if
prop
!=
' '
:
self
.
tag_add
(
prop
,
here
,
AtInsert
())
# Readonly Man Page class -- disables editing, otherwise the same
class
ReadonlyManPage
(
EditableManPage
):
"""Readonly Man Page class -- disables editing, otherwise the same."""
# Initialize instance
def
__init__
(
self
,
master
=
None
,
**
cnf
):
cnf
[
'state'
]
=
DISABLED
EditableManPage
.
__init__
(
self
,
master
,
**
cnf
)
...
...
@@ -183,12 +182,9 @@ class ReadonlyManPage(EditableManPage):
# Alias
ManPage
=
ReadonlyManPage
# Test program.
# usage: ManPage [manpage]; or ManPage [-f] file
# -f means that the file is nroff -man output run through ul -i
def
test
():
import
os
import
sys
def
main
():
# XXX This directory may be different on your system
MANDIR
=
''
DEFAULTPAGE
=
'Tcl'
...
...
@@ -211,10 +207,9 @@ def test():
if
formatted
:
fp
=
open
(
name
,
'r'
)
else
:
fp
=
os
.
popen
(
'nroff -man
%
s | ul -i'
%
name
,
'r'
)
fp
=
os
.
popen
(
'nroff -man
-c
%
s | ul -i'
%
name
,
'r'
)
manpage
.
parsefile
(
fp
)
root
.
mainloop
()
# Run the test program when called as a script
if
__name__
==
'__main__'
:
test
()
main
()
Demo/tkinter/guido/mbox.py
Dosyayı görüntüle @
f19ff1ea
...
...
@@ -192,7 +192,7 @@ def open_message(e=None):
num
=
int
(
m
.
group
(
1
))
m
=
mhf
.
get_message
(
num
)
if
viewer
:
viewer
.
destroy
()
from
MimeV
iewer
import
MimeViewer
from
mimev
iewer
import
MimeViewer
viewer
=
MimeViewer
(
bot
,
'+
%
s/
%
d'
%
(
folder
,
num
),
m
)
viewer
.
pack
()
viewer
.
show
()
...
...
Demo/tkinter/guido/
MimeV
iewer.py
→
Demo/tkinter/guido/
mimev
iewer.py
Dosyayı görüntüle @
f19ff1ea
File moved
Demo/tkinter/guido/
ShellW
indow.py
→
Demo/tkinter/guido/
shell_w
indow.py
Dosyayı görüntüle @
f19ff1ea
File moved
Demo/tkinter/guido/sortvisu.py
Dosyayı görüntüle @
f19ff1ea
...
...
@@ -18,7 +18,6 @@ stand-alone application.
"""
from
tkinter
import
*
import
random
...
...
@@ -201,27 +200,28 @@ class ArrayItem:
self
.
value
=
value
self
.
canvas
=
array
.
canvas
x1
,
y1
,
x2
,
y2
=
self
.
position
()
self
.
item
=
array
.
canvas
.
create_rectangle
(
x1
,
y1
,
x2
,
y2
,
self
.
item
_id
=
array
.
canvas
.
create_rectangle
(
x1
,
y1
,
x2
,
y2
,
fill
=
'red'
,
outline
=
'black'
,
width
=
1
)
array
.
canvas
.
tag_bind
(
self
.
item
,
'<Button-1>'
,
self
.
mouse_down
)
array
.
canvas
.
tag_bind
(
self
.
item
,
'<Button1-Motion>'
,
self
.
mouse_move
)
array
.
canvas
.
tag_bind
(
self
.
item
,
'<ButtonRelease-1>'
,
self
.
mouse_up
)
self
.
canvas
.
tag_bind
(
self
.
item_id
,
'<Button-1>'
,
self
.
mouse_down
)
self
.
canvas
.
tag_bind
(
self
.
item_id
,
'<Button1-Motion>'
,
self
.
mouse_move
)
self
.
canvas
.
tag_bind
(
self
.
item_id
,
'<ButtonRelease-1>'
,
self
.
mouse_up
)
def
delete
(
self
):
item
=
self
.
item
item
_id
=
self
.
item_id
self
.
array
=
None
self
.
item
=
None
item
.
delete
(
)
self
.
item
_id
=
None
self
.
canvas
.
delete
(
item_id
)
def
mouse_down
(
self
,
event
):
self
.
lastx
=
event
.
x
self
.
lasty
=
event
.
y
self
.
origx
=
event
.
x
self
.
origy
=
event
.
y
self
.
item
.
tkraise
(
)
self
.
canvas
.
tag_raise
(
self
.
item_id
)
def
mouse_move
(
self
,
event
):
self
.
item
.
move
(
event
.
x
-
self
.
lastx
,
event
.
y
-
self
.
lasty
)
self
.
canvas
.
move
(
self
.
item_id
,
event
.
x
-
self
.
lastx
,
event
.
y
-
self
.
lasty
)
self
.
lastx
=
event
.
x
self
.
lasty
=
event
.
y
...
...
@@ -236,7 +236,7 @@ class ArrayItem:
self
.
array
.
items
[
here
],
self
.
array
.
items
[
i
]
=
other
,
self
self
.
index
=
i
x1
,
y1
,
x2
,
y2
=
self
.
position
()
self
.
canvas
.
coords
(
self
.
item
,
(
x1
,
y1
,
x2
,
y2
))
self
.
canvas
.
coords
(
self
.
item
_id
,
(
x1
,
y1
,
x2
,
y2
))
other
.
setindex
(
here
)
def
setindex
(
self
,
index
):
...
...
@@ -248,9 +248,9 @@ class ArrayItem:
self
.
index
=
index
newpts
=
self
.
position
()
trajectory
=
interpolate
(
oldpts
,
newpts
,
nsteps
)
self
.
item
.
tkraise
(
)
self
.
canvas
.
tag_raise
(
self
.
item_id
)
for
pts
in
trajectory
:
self
.
canvas
.
coords
(
self
.
item
,
pts
)
self
.
canvas
.
coords
(
self
.
item
_id
,
pts
)
self
.
array
.
wait
(
50
)
def
swapwith
(
self
,
other
):
...
...
@@ -263,45 +263,45 @@ class ArrayItem:
self
.
index
,
other
.
index
=
other
.
index
,
self
.
index
mynewpts
=
self
.
position
()
othernewpts
=
other
.
position
()
myfill
=
self
.
canvas
.
itemcget
(
self
.
item
,
'fill'
)
otherfill
=
self
.
canvas
.
itemcget
(
other
.
item
,
'fill'
)
self
.
canvas
.
itemconfig
(
self
.
item
,
fill
=
'green'
)
self
.
canvas
.
itemconfig
(
other
.
item
,
fill
=
'yellow'
)
myfill
=
self
.
canvas
.
itemcget
(
self
.
item
_id
,
'fill'
)
otherfill
=
self
.
canvas
.
itemcget
(
other
.
item
_id
,
'fill'
)
self
.
canvas
.
itemconfig
(
self
.
item
_id
,
fill
=
'green'
)
self
.
canvas
.
itemconfig
(
other
.
item
_id
,
fill
=
'yellow'
)
self
.
array
.
master
.
update
()
if
self
.
array
.
speed
==
"single-step"
:
self
.
canvas
.
coords
(
self
.
item
,
mynewpts
)
self
.
canvas
.
coords
(
other
.
item
,
othernewpts
)
self
.
canvas
.
coords
(
self
.
item
_id
,
mynewpts
)
self
.
canvas
.
coords
(
other
.
item
_id
,
othernewpts
)
self
.
array
.
master
.
update
()
self
.
canvas
.
itemconfig
(
self
.
item
,
fill
=
myfill
)
self
.
canvas
.
itemconfig
(
other
.
item
,
fill
=
otherfill
)
self
.
canvas
.
itemconfig
(
self
.
item
_id
,
fill
=
myfill
)
self
.
canvas
.
itemconfig
(
other
.
item
_id
,
fill
=
otherfill
)
self
.
array
.
wait
(
0
)
return
mytrajectory
=
interpolate
(
myoldpts
,
mynewpts
,
nsteps
)
othertrajectory
=
interpolate
(
otheroldpts
,
othernewpts
,
nsteps
)
if
self
.
value
>
other
.
value
:
self
.
canvas
.
tag_raise
(
self
.
item
)
self
.
canvas
.
tag_raise
(
other
.
item
)
self
.
canvas
.
tag_raise
(
self
.
item
_id
)
self
.
canvas
.
tag_raise
(
other
.
item
_id
)
else
:
self
.
canvas
.
tag_raise
(
other
.
item
)
self
.
canvas
.
tag_raise
(
self
.
item
)
self
.
canvas
.
tag_raise
(
other
.
item
_id
)
self
.
canvas
.
tag_raise
(
self
.
item
_id
)
try
:
for
i
in
range
(
len
(
mytrajectory
)):
mypts
=
mytrajectory
[
i
]
otherpts
=
othertrajectory
[
i
]
self
.
canvas
.
coords
(
self
.
item
,
mypts
)
self
.
canvas
.
coords
(
other
.
item
,
otherpts
)
self
.
canvas
.
coords
(
self
.
item
_id
,
mypts
)
self
.
canvas
.
coords
(
other
.
item
_id
,
otherpts
)
self
.
array
.
wait
(
50
)
finally
:
mypts
=
mytrajectory
[
-
1
]
otherpts
=
othertrajectory
[
-
1
]
self
.
canvas
.
coords
(
self
.
item
,
mypts
)
self
.
canvas
.
coords
(
other
.
item
,
otherpts
)
self
.
canvas
.
itemconfig
(
self
.
item
,
fill
=
myfill
)
self
.
canvas
.
itemconfig
(
other
.
item
,
fill
=
otherfill
)
self
.
canvas
.
coords
(
self
.
item
_id
,
mypts
)
self
.
canvas
.
coords
(
other
.
item
_id
,
otherpts
)
self
.
canvas
.
itemconfig
(
self
.
item
_id
,
fill
=
myfill
)
self
.
canvas
.
itemconfig
(
other
.
item
_id
,
fill
=
otherfill
)
def
compareto
(
self
,
other
):
myfill
=
self
.
canvas
.
itemcget
(
self
.
item
,
'fill'
)
otherfill
=
self
.
canvas
.
itemcget
(
other
.
item
,
'fill'
)
myfill
=
self
.
canvas
.
itemcget
(
self
.
item
_id
,
'fill'
)
otherfill
=
self
.
canvas
.
itemcget
(
other
.
item
_id
,
'fill'
)
if
self
.
value
<
other
.
value
:
myflash
=
'white'
otherflash
=
'black'
...
...
@@ -314,12 +314,12 @@ class ArrayItem:
myflash
=
otherflash
=
'grey'
outcome
=
0
try
:
self
.
canvas
.
itemconfig
(
self
.
item
,
fill
=
myflash
)
self
.
canvas
.
itemconfig
(
other
.
item
,
fill
=
otherflash
)
self
.
canvas
.
itemconfig
(
self
.
item
_id
,
fill
=
myflash
)
self
.
canvas
.
itemconfig
(
other
.
item
_id
,
fill
=
otherflash
)
self
.
array
.
wait
(
500
)
finally
:
self
.
canvas
.
itemconfig
(
self
.
item
,
fill
=
myfill
)
self
.
canvas
.
itemconfig
(
other
.
item
,
fill
=
otherfill
)
self
.
canvas
.
itemconfig
(
self
.
item
_id
,
fill
=
myfill
)
self
.
canvas
.
itemconfig
(
other
.
item
_id
,
fill
=
otherfill
)
return
outcome
def
position
(
self
):
...
...
Demo/tkinter/guido/ss1.py
Dosyayı görüntüle @
f19ff1ea
...
...
@@ -3,7 +3,7 @@
import
os
import
re
import
sys
import
cgi
import
html
from
xml.parsers
import
expat
LEFT
,
CENTER
,
RIGHT
=
"LEFT"
,
"CENTER"
,
"RIGHT"
...
...
@@ -201,7 +201,7 @@ class Sheet:
if
hasattr
(
cell
,
'xml'
):
cellxml
=
cell
.
xml
()
else
:
cellxml
=
'<value>
%
s</value>'
%
cgi
.
escape
(
cell
)
cellxml
=
'<value>
%
s</value>'
%
html
.
escape
(
cell
)
out
.
append
(
'<cell row="
%
s" col="
%
s">
\n
%
s
\n
</cell>'
%
(
y
,
x
,
cellxml
))
out
.
append
(
'</spreadsheet>'
)
...
...
@@ -216,7 +216,7 @@ class Sheet:
f
.
close
()
def
load
(
self
,
filename
):
f
=
open
(
filename
,
'r'
)
f
=
open
(
filename
,
'r
b
'
)
SheetParser
(
self
)
.
parsefile
(
f
)
f
.
close
()
...
...
@@ -382,7 +382,7 @@ class StringCell(BaseCell):
return
s
%
(
align2xml
[
self
.
alignment
],
self
.
fmt
,
cgi
.
escape
(
self
.
text
))
html
.
escape
(
self
.
text
))
class
FormulaCell
(
BaseCell
):
...
...
Demo/tkinter/guido/tkman.py
Dosyayı görüntüle @
f19ff1ea
...
...
@@ -7,10 +7,10 @@ import re
import
sys
from
tkinter
import
*
from
ManP
age
import
ManPage
from
manp
age
import
ManPage
MANNDIRLIST
=
[
'/
depot/sundry/man/mann'
,
'/usr/local
/man/mann'
]
MAN3DIRLIST
=
[
'/
depot/sundry/man/man3'
,
'/usr/local
/man/man3'
]
MANNDIRLIST
=
[
'/
usr/local/man/mann'
,
'/usr/share
/man/mann'
]
MAN3DIRLIST
=
[
'/
usr/local/man/man3'
,
'/usr/share
/man/man3'
]
foundmanndir
=
0
for
dir
in
MANNDIRLIST
:
...
...
@@ -197,7 +197,7 @@ class SelectionBox:
def
show_page
(
self
,
name
):
file
=
'
%
s/
%
s.?'
%
(
self
.
chaptervar
.
get
(),
name
)
fp
=
os
.
popen
(
'nroff -man
%
s | ul -i'
%
file
,
'r'
)
fp
=
os
.
popen
(
'nroff -man
-c
%
s | ul -i'
%
file
,
'r'
)
self
.
text
.
kill
()
self
.
title
[
'text'
]
=
name
self
.
text
.
parsefile
(
fp
)
...
...
Demo/tkinter/guido/wish.py
Dosyayı görüntüle @
f19ff1ea
...
...
@@ -4,21 +4,25 @@ import _tkinter
import
os
import
sys
tk
=
_tkinter
.
create
(
os
.
environ
[
'DISPLAY'
],
'wish'
,
'Tk'
,
1
)
tk
=
_tkinter
.
create
(
os
.
environ
[
'DISPLAY'
],
'wish'
,
'Tk'
,
1
,
1
)
tk
.
call
(
'update'
)
cmd
=
''
while
1
:
if
cmd
:
prompt
=
''
else
:
prompt
=
'
%
'
while
True
:
if
cmd
:
prompt
=
''
else
:
prompt
=
'
%
'
try
:
sys
.
stdout
.
write
(
prompt
)
sys
.
stdout
.
flush
()
line
=
sys
.
stdin
.
readline
()
if
not
line
:
break
except
EOFError
:
break
cmd
=
cmd
+
(
line
+
'
\n
'
)
cmd
+=
line
if
tk
.
getboolean
(
tk
.
call
(
'info'
,
'complete'
,
cmd
)):
tk
.
record
(
line
)
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment