GRAYBYTE WORDPRESS FILE MANAGER9975

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
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/curses/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /usr/lib64/python2.7/Demo/curses//repeat.py
#! /usr/bin/python2.7

"""repeat <shell-command>

This simple program repeatedly (at 1-second intervals) executes the
shell command given on the command line and displays the output (or as
much of it as fits on the screen).  It uses curses to paint each new
output on top of the old output, so that if nothing changes, the
screen doesn't change.  This is handy to watch for changes in e.g. a
directory or process listing.

To end, hit Control-C.
"""

# Author: Guido van Rossum

# Disclaimer: there's a Linux program named 'watch' that does the same
# thing.  Honestly, I didn't know of its existence when I wrote this!

# To do: add features until it has the same functionality as watch(1);
# then compare code size and development time.

import os
import sys
import time
import curses

def main():
    if not sys.argv[1:]:
        print __doc__
        sys.exit(0)
    cmd = " ".join(sys.argv[1:])
    p = os.popen(cmd, "r")
    text = p.read()
    sts = p.close()
    if sts:
        print >>sys.stderr, "Exit code:", sts
        sys.exit(sts)
    w = curses.initscr()
    try:
        while True:
            w.erase()
            try:
                w.addstr(text)
            except curses.error:
                pass
            w.refresh()
            time.sleep(1)
            p = os.popen(cmd, "r")
            text = p.read()
            sts = p.close()
            if sts:
                print >>sys.stderr, "Exit code:", sts
                sys.exit(sts)
    finally:
        curses.endwin()

main()

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
June 15 2024 08:34:37
root / root
0755
README
0.832 KB
April 19 2020 21:13:39
root / root
0644
life.py
7.177 KB
April 10 2024 04:57:37
root / root
0755
life.pyc
6.628 KB
April 10 2024 04:58:46
root / root
0644
life.pyo
6.628 KB
April 10 2024 04:58:46
root / root
0644
ncurses.py
6.492 KB
April 10 2024 04:57:37
root / root
0755
ncurses.pyc
5.708 KB
April 10 2024 04:58:46
root / root
0644
ncurses.pyo
5.708 KB
April 10 2024 04:58:46
root / root
0644
rain.py
2.347 KB
April 10 2024 04:57:37
root / root
0755
rain.pyc
2.241 KB
April 10 2024 04:58:46
root / root
0644
rain.pyo
2.241 KB
April 10 2024 04:58:46
root / root
0644
repeat.py
1.479 KB
April 10 2024 04:57:37
root / root
0755
repeat.pyc
1.419 KB
April 10 2024 04:58:46
root / root
0644
repeat.pyo
1.419 KB
April 10 2024 04:58:46
root / root
0644
tclock.py
3.253 KB
April 10 2024 04:57:37
root / root
0755
tclock.pyc
3.563 KB
April 10 2024 04:58:46
root / root
0644
tclock.pyo
3.563 KB
April 10 2024 04:58:46
root / root
0644
xmas.py
24.85 KB
April 19 2020 21:13:39
root / root
0644
xmas.pyc
19.398 KB
April 10 2024 04:58:46
root / root
0644
xmas.pyo
19.398 KB
April 10 2024 04:58:46
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF