晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /usr/lib64/python2.7/Demo/scripts/ |
Upload File : |
#! /usr/bin/python2.7
# Emulate some Perl command line options.
# Usage: pp [-a] [-c] [-d] [-e scriptline] [-F fieldsep] [-n] [-p] [file] ...
# Where the options mean the following:
# -a : together with -n or -p, splits each line into list F
# -c : check syntax only, do not execute any code
# -d : run the script under the debugger, pdb
# -e scriptline : gives one line of the Python script; may be repeated
# -F fieldsep : sets the field separator for the -a option [not in Perl]
# -n : runs the script for each line of input
# -p : prints the line after the script has run
# When no script lines have been passed, the first file argument
# contains the script. With -n or -p, the remaining arguments are
# read as input to the script, line by line. If a file is '-'
# or missing, standard input is read.
# XXX To do:
# - add -i extension option (change files in place)
# - make a single loop over the files and lines (changes effect of 'break')?
# - add an option to specify the record separator
# - except for -n/-p, run directly from the file if at all possible
import sys
import getopt
FS = ''
SCRIPT = []
AFLAG = 0
CFLAG = 0
DFLAG = 0
NFLAG = 0
PFLAG = 0
try:
optlist, ARGS = getopt.getopt(sys.argv[1:], 'acde:F:np')
except getopt.error, msg:
sys.stderr.write('%s: %s\n' % (sys.argv[0], msg))
sys.exit(2)
for option, optarg in optlist:
if option == '-a':
AFLAG = 1
elif option == '-c':
CFLAG = 1
elif option == '-d':
DFLAG = 1
elif option == '-e':
for line in optarg.split('\n'):
SCRIPT.append(line)
elif option == '-F':
FS = optarg
elif option == '-n':
NFLAG = 1
PFLAG = 0
elif option == '-p':
NFLAG = 1
PFLAG = 1
else:
print option, 'not recognized???'
if not ARGS: ARGS.append('-')
if not SCRIPT:
if ARGS[0] == '-':
fp = sys.stdin
else:
fp = open(ARGS[0], 'r')
while 1:
line = fp.readline()
if not line: break
SCRIPT.append(line[:-1])
del fp
del ARGS[0]
if not ARGS: ARGS.append('-')
if CFLAG:
prologue = ['if 0:']
epilogue = []
elif NFLAG:
# Note that it is on purpose that AFLAG and PFLAG are
# tested dynamically each time through the loop
prologue = [
'LINECOUNT = 0',
'for FILE in ARGS:',
' \tif FILE == \'-\':',
' \t \tFP = sys.stdin',
' \telse:',
' \t \tFP = open(FILE, \'r\')',
' \tLINENO = 0',
' \twhile 1:',
' \t \tLINE = FP.readline()',
' \t \tif not LINE: break',
' \t \tLINENO = LINENO + 1',
' \t \tLINECOUNT = LINECOUNT + 1',
' \t \tL = LINE[:-1]',
' \t \taflag = AFLAG',
' \t \tif aflag:',
' \t \t \tif FS: F = L.split(FS)',
' \t \t \telse: F = L.split()'
]
epilogue = [
' \t \tif not PFLAG: continue',
' \t \tif aflag:',
' \t \t \tif FS: print FS.join(F)',
' \t \t \telse: print \' \'.join(F)',
' \t \telse: print L',
]
else:
prologue = ['if 1:']
epilogue = []
# Note that we indent using tabs only, so that any indentation style
# used in 'command' will come out right after re-indentation.
program = '\n'.join(prologue) + '\n'
for line in SCRIPT:
program += ' \t \t' + line + '\n'
program += '\n'.join(epilogue) + '\n'
import tempfile
fp = tempfile.NamedTemporaryFile()
fp.write(program)
fp.flush()
if DFLAG:
import pdb
pdb.run('execfile(%r)' % (fp.name,))
else:
execfile(fp.name)