GRAYBYTE WORDPRESS FILE MANAGER4513

Server IP : 198.54.121.189 / Your IP : 216.73.216.224
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /usr/lib64/python2.7/Demo/tkinter/guido/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /usr/lib64/python2.7/Demo/tkinter/guido//rmt.py
#! /usr/bin/python2.7

# A Python program implementing rmt, an application for remotely
# controlling other Tk applications.
# Cf. Ousterhout, Tcl and the Tk Toolkit, Figs. 27.5-8, pp. 273-276.

# Note that because of forward references in the original, we
# sometimes delay bindings until after the corresponding procedure is
# defined.  We also introduce names for some unnamed code blocks in
# the original because of restrictions on lambda forms in Python.

# XXX This should be written in a more Python-like style!!!

from Tkinter import *
import sys

# 1. Create basic application structure: menu bar on top of
# text widget, scrollbar on right.

root = Tk()
tk = root.tk
mBar = Frame(root, relief=RAISED, borderwidth=2)
mBar.pack(fill=X)

f = Frame(root)
f.pack(expand=1, fill=BOTH)
s = Scrollbar(f, relief=FLAT)
s.pack(side=RIGHT, fill=Y)
t = Text(f, relief=RAISED, borderwidth=2, yscrollcommand=s.set, setgrid=1)
t.pack(side=LEFT, fill=BOTH, expand=1)
t.tag_config('bold', font='-Adobe-Courier-Bold-R-Normal-*-120-*')
s['command'] = t.yview

root.title('Tk Remote Controller')
root.iconname('Tk Remote')

# 2. Create menu button and menus.

file = Menubutton(mBar, text='File', underline=0)
file.pack(side=LEFT)
file_m = Menu(file)
file['menu'] = file_m
file_m_apps = Menu(file_m, tearoff=0)
file_m.add_cascade(label='Select Application', underline=0,
                   menu=file_m_apps)
file_m.add_command(label='Quit', underline=0, command=sys.exit)

# 3. Create bindings for text widget to allow commands to be
# entered and information to be selected.  New characters
# can only be added at the end of the text (can't ever move
# insertion point).

def single1(e):
    x = e.x
    y = e.y
    t.setvar('tk_priv(selectMode)', 'char')
    t.mark_set('anchor', At(x, y))
    # Should focus W
t.bind('<1>', single1)

def double1(e):
    x = e.x
    y = e.y
    t.setvar('tk_priv(selectMode)', 'word')
    t.tk_textSelectTo(At(x, y))
t.bind('<Double-1>', double1)

def triple1(e):
    x = e.x
    y = e.y
    t.setvar('tk_priv(selectMode)', 'line')
    t.tk_textSelectTo(At(x, y))
t.bind('<Triple-1>', triple1)

def returnkey(e):
    t.insert(AtInsert(), '\n')
    invoke()
t.bind('<Return>', returnkey)

def controlv(e):
    t.insert(AtInsert(), t.selection_get())
    t.yview_pickplace(AtInsert())
    if t.index(AtInsert())[-2:] == '.0':
        invoke()
t.bind('<Control-v>', controlv)

# 4. Procedure to backspace over one character, as long as
# the character isn't part of the prompt.

def backspace(e):
    if t.index('promptEnd') != t.index('insert - 1 char'):
        t.delete('insert - 1 char', AtInsert())
        t.yview_pickplace(AtInsert())
t.bind('<BackSpace>', backspace)
t.bind('<Control-h>', backspace)
t.bind('<Delete>', backspace)


# 5. Procedure that's invoked when return is typed:  if
# there's not yet a complete command (e.g. braces are open)
# then do nothing.  Otherwise, execute command (locally or
# remotely), output the result or error message, and issue
# a new prompt.

def invoke():
    cmd = t.get('promptEnd + 1 char', AtInsert())
    if t.getboolean(tk.call('info', 'complete', cmd)): # XXX
        if app == root.winfo_name():
            msg = tk.call('eval', cmd) # XXX
        else:
            msg = t.send(app, cmd)
        if msg:
            t.insert(AtInsert(), msg + '\n')
        prompt()
    t.yview_pickplace(AtInsert())

def prompt():
    t.insert(AtInsert(), app + ': ')
    t.mark_set('promptEnd', 'insert - 1 char')
    t.tag_add('bold', 'insert linestart', 'promptEnd')

# 6. Procedure to select a new application.  Also changes
# the prompt on the current command line to reflect the new
# name.

def newApp(appName):
    global app
    app = appName
    t.delete('promptEnd linestart', 'promptEnd')
    t.insert('promptEnd', appName + ':')
    t.tag_add('bold', 'promptEnd linestart', 'promptEnd')

def fillAppsMenu():
    file_m_apps.add('command')
    file_m_apps.delete(0, 'last')
    names = root.winfo_interps()
    names = list(names)
    names.sort()
    for name in names:
        try:
            root.send(name, 'winfo name .')
        except TclError:
            # Inoperative window -- ignore it
            pass
        else:
            file_m_apps.add_command(
                label=name,
                command=lambda name=name: newApp(name))

file_m_apps['postcommand'] = fillAppsMenu
mBar.tk_menuBar(file)

# 7. Miscellaneous initialization.

app = root.winfo_name()
prompt()
t.focus()

root.mainloop()

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
June 15 2024 08:34:37
root / root
0755
AttrDialog.py
14.004 KB
April 19 2020 21:13:39
root / root
0644
AttrDialog.pyc
18.325 KB
April 10 2024 04:58:47
root / root
0644
AttrDialog.pyo
18.325 KB
April 10 2024 04:58:47
root / root
0644
ManPage.py
6.695 KB
April 19 2020 21:13:39
root / root
0644
ManPage.pyc
6.272 KB
April 10 2024 04:58:47
root / root
0644
ManPage.pyo
6.272 KB
April 10 2024 04:58:47
root / root
0644
MimeViewer.py
4.392 KB
April 10 2024 04:57:37
root / root
0755
MimeViewer.pyc
4.833 KB
April 10 2024 04:58:47
root / root
0644
MimeViewer.pyo
4.833 KB
April 10 2024 04:58:47
root / root
0644
ShellWindow.py
4.074 KB
April 19 2020 21:13:39
root / root
0644
ShellWindow.pyc
5.47 KB
April 10 2024 04:58:47
root / root
0644
ShellWindow.pyo
5.47 KB
April 10 2024 04:58:47
root / root
0644
brownian.py
1.065 KB
April 19 2020 21:13:39
root / root
0644
brownian.pyc
1.587 KB
April 10 2024 04:58:47
root / root
0644
brownian.pyo
1.587 KB
April 10 2024 04:58:47
root / root
0644
brownian2.py
1.347 KB
April 19 2020 21:13:39
root / root
0644
brownian2.pyc
1.743 KB
April 10 2024 04:58:47
root / root
0644
brownian2.pyo
1.743 KB
April 10 2024 04:58:47
root / root
0644
canvasevents.py
6.45 KB
April 10 2024 04:57:37
root / root
0755
canvasevents.pyc
10.465 KB
April 10 2024 04:58:47
root / root
0644
canvasevents.pyo
10.465 KB
April 10 2024 04:58:47
root / root
0644
dialog.py
3.126 KB
April 10 2024 04:57:37
root / root
0755
dialog.pyc
3.108 KB
April 10 2024 04:58:47
root / root
0644
dialog.pyo
3.108 KB
April 10 2024 04:58:47
root / root
0644
electrons.py
2.268 KB
April 10 2024 04:57:37
root / root
0755
electrons.pyc
2.33 KB
April 10 2024 04:58:47
root / root
0644
electrons.pyo
2.33 KB
April 10 2024 04:58:47
root / root
0644
hanoi.py
4.54 KB
April 19 2020 21:13:39
root / root
0644
hanoi.pyc
3.821 KB
April 10 2024 04:58:47
root / root
0644
hanoi.pyo
3.821 KB
April 10 2024 04:58:47
root / root
0644
hello.py
0.323 KB
April 19 2020 21:13:39
root / root
0644
hello.pyc
0.685 KB
April 10 2024 04:58:47
root / root
0644
hello.pyo
0.685 KB
April 10 2024 04:58:47
root / root
0644
imagedraw.py
0.497 KB
April 19 2020 21:13:39
root / root
0644
imagedraw.pyc
1.128 KB
April 10 2024 04:58:47
root / root
0644
imagedraw.pyo
1.128 KB
April 10 2024 04:58:47
root / root
0644
imageview.py
0.2 KB
April 19 2020 21:13:39
root / root
0644
imageview.pyc
0.557 KB
April 10 2024 04:58:47
root / root
0644
imageview.pyo
0.557 KB
April 10 2024 04:58:47
root / root
0644
kill.py
3.793 KB
April 10 2024 04:57:37
root / root
0755
kill.pyc
4.813 KB
April 10 2024 04:58:47
root / root
0644
kill.pyo
4.813 KB
April 10 2024 04:58:47
root / root
0644
listtree.py
0.968 KB
April 19 2020 21:13:39
root / root
0644
listtree.pyc
1.497 KB
April 10 2024 04:58:47
root / root
0644
listtree.pyo
1.497 KB
April 10 2024 04:58:47
root / root
0644
mbox.py
7.302 KB
April 10 2024 04:57:37
root / root
0755
mbox.pyc
8.173 KB
April 10 2024 04:58:47
root / root
0644
mbox.pyo
8.173 KB
April 10 2024 04:58:47
root / root
0644
newmenubardemo.py
1.203 KB
April 10 2024 04:57:37
root / root
0755
newmenubardemo.pyc
1.586 KB
April 10 2024 04:58:47
root / root
0644
newmenubardemo.pyo
1.586 KB
April 10 2024 04:58:47
root / root
0644
optionmenu.py
0.431 KB
April 19 2020 21:13:39
root / root
0644
optionmenu.pyc
0.58 KB
April 10 2024 04:58:47
root / root
0644
optionmenu.pyo
0.58 KB
April 10 2024 04:58:47
root / root
0644
paint.py
1.854 KB
April 19 2020 21:13:39
root / root
0644
paint.pyc
2.19 KB
April 10 2024 04:58:47
root / root
0644
paint.pyo
2.19 KB
April 10 2024 04:58:47
root / root
0644
rmt.py
4.386 KB
April 10 2024 04:57:37
root / root
0755
rmt.pyc
4.927 KB
April 10 2024 04:58:47
root / root
0644
rmt.pyo
4.927 KB
April 10 2024 04:58:47
root / root
0644
solitaire.py
17.372 KB
April 10 2024 04:57:37
root / root
0755
solitaire.pyc
20.407 KB
April 10 2024 04:58:47
root / root
0644
solitaire.pyo
20.407 KB
April 10 2024 04:58:47
root / root
0644
sortvisu.py
18.893 KB
April 10 2024 04:57:37
root / root
0755
sortvisu.pyc
23.183 KB
April 10 2024 04:58:47
root / root
0644
sortvisu.pyo
23.183 KB
April 10 2024 04:58:47
root / root
0644
ss1.py
25.569 KB
April 19 2020 21:13:39
root / root
0644
ss1.pyc
31.667 KB
April 10 2024 04:58:47
root / root
0644
ss1.pyo
31.072 KB
April 10 2024 04:58:44
root / root
0644
svkill.py
4.75 KB
April 10 2024 04:57:37
root / root
0755
svkill.pyc
5.802 KB
April 10 2024 04:58:47
root / root
0644
svkill.pyo
5.802 KB
April 10 2024 04:58:47
root / root
0644
switch.py
1.522 KB
April 19 2020 21:13:39
root / root
0644
switch.pyc
2.853 KB
April 10 2024 04:58:47
root / root
0644
switch.pyo
2.853 KB
April 10 2024 04:58:47
root / root
0644
tkman.py
8.793 KB
April 10 2024 04:57:37
root / root
0755
tkman.pyc
8.876 KB
April 10 2024 04:58:47
root / root
0644
tkman.pyo
8.876 KB
April 10 2024 04:58:47
root / root
0644
wish.py
0.608 KB
April 19 2020 21:13:39
root / root
0644
wish.pyc
0.72 KB
April 10 2024 04:58:47
root / root
0644
wish.pyo
0.72 KB
April 10 2024 04:58:47
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF