X7ROOT File Manager
Current Path:
/lib64/python2.7/Demo/scripts
lib64
/
python2.7
/
Demo
/
scripts
/
ðŸ“
..
📄
README
(1009 B)
📄
beer.py
(458 B)
📄
beer.pyc
(703 B)
📄
beer.pyo
(703 B)
📄
eqfix.py
(6.16 KB)
📄
eqfix.pyc
(4.53 KB)
📄
eqfix.pyo
(4.53 KB)
📄
fact.py
(1.11 KB)
📄
fact.pyc
(1.14 KB)
📄
fact.pyo
(1.14 KB)
📄
find-uname.py
(1.18 KB)
📄
find-uname.pyc
(1.47 KB)
📄
find-uname.pyo
(1.47 KB)
📄
from.py
(873 B)
📄
from.pyc
(751 B)
📄
from.pyo
(751 B)
📄
lpwatch.py
(2.77 KB)
📄
lpwatch.pyc
(2.54 KB)
📄
lpwatch.pyo
(2.54 KB)
📄
makedir.py
(509 B)
📄
makedir.pyc
(732 B)
📄
makedir.pyo
(732 B)
📄
markov.py
(3.5 KB)
📄
markov.pyc
(3.93 KB)
📄
markov.pyo
(3.93 KB)
📄
mboxconvert.py
(3.11 KB)
📄
mboxconvert.pyc
(3.18 KB)
📄
mboxconvert.pyo
(3.18 KB)
📄
morse.py
(4.21 KB)
📄
morse.pyc
(4.33 KB)
📄
morse.pyo
(4.33 KB)
📄
pi.py
(887 B)
📄
pi.pyc
(921 B)
📄
pi.pyo
(921 B)
📄
pp.py
(3.72 KB)
📄
pp.pyc
(2.28 KB)
📄
pp.pyo
(2.28 KB)
📄
primes.py
(602 B)
📄
primes.pyc
(921 B)
📄
primes.pyo
(921 B)
📄
queens.py
(2.19 KB)
📄
queens.pyc
(2.95 KB)
📄
queens.pyo
(2.95 KB)
📄
script.py
(961 B)
📄
script.pyc
(1.21 KB)
📄
script.pyo
(1.21 KB)
📄
unbirthday.py
(3.07 KB)
📄
unbirthday.pyc
(2.93 KB)
📄
unbirthday.pyo
(2.93 KB)
📄
update.py
(2.68 KB)
📄
update.pyc
(2.69 KB)
📄
update.pyo
(2.69 KB)
Editing: script.py
#! /usr/bin/python2.7 # script.py -- Make typescript of terminal session. # Usage: # -a Append to typescript. # -p Use Python as shell. # Author: Steen Lumholt. import os, time, sys, getopt import pty def read(fd): data = os.read(fd, 1024) script.write(data) return data shell = 'sh' filename = 'typescript' mode = 'w' if os.environ.has_key('SHELL'): shell = os.environ['SHELL'] try: opts, args = getopt.getopt(sys.argv[1:], 'ap') except getopt.error, msg: print '%s: %s' % (sys.argv[0], msg) sys.exit(2) for o, a in opts: if o == '-a': mode = 'a' elif o == '-p': shell = 'python' script = open(filename, mode) sys.stdout.write('Script started, file is %s\n' % filename) script.write('Script started on %s\n' % time.ctime(time.time())) pty.spawn(shell, read) script.write('Script done on %s\n' % time.ctime(time.time())) sys.stdout.write('Script done, file is %s\n' % filename)
Upload File
Create Folder