File: trim.py

package info (click to toggle)
pymol 2.2.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 43,400 kB
  • sloc: cpp: 482,465; python: 81,253; ansic: 27,428; sh: 94; makefile: 32; csh: 8
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)