striplog
来自「gpsd, a popular GPS daemon.」· 代码 · 共 26 行
TXT
26 行
#!/usr/bin/python## striplog -- strip leading lines from logs## striplog -1 strips the first line only.# striplog with no option strips all leading lines beginning with ##import getopt, sysfirstline = False(options, argumwnts) = getopt.getopt(sys.argv[1:], "1")for (switch, val) in options: if (switch == '-1'): firstline = Trueif firstline: sys.stdin.readline()else: while True: line = sys.stdin.readline() if line[0] != '#': break sys.stdout.write(line)sys.stdout.write(sys.stdin.read())
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?