File: trim.py

package info (click to toggle)
pymol 1.8.4.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 42,248 kB
  • ctags: 24,095
  • sloc: cpp: 474,635; python: 75,034; ansic: 22,888; sh: 236; makefile: 78; 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)