File: trim.py

package info (click to toggle)
pymol 0.98%2B0.99rc6-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 18,996 kB
  • ctags: 17,409
  • sloc: ansic: 206,868; python: 51,428; sh: 743; makefile: 382; csh: 21
file content (18 lines) | stat: -rw-r--r-- 319 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import sys
import string

f = sys.stdin
g = sys.stdout

echo = 0
while 1:
   l = f.readline()
   if not l: break
   ll=string.strip(l)
   if ll=='BEGIN-LOG':
      echo = 1
   elif ll=='END-LOG':
      echo = 0
   elif echo:
      l=string.replace(l,"-0.000"," 0.000") # squish annoying negative zeros
      g.write(l)