plint

French poetry validator (local mirror of https://gitlab.com/a3nm/plint)
git clone https://a3nm.net/git/plint/
Log | Files | Refs | README

parse_dramacode_paroles.py (265B)


      1 #!/usr/bin/python3
      2 
      3 import sys
      4 
      5 last = None
      6 for l in sys.stdin.readlines():
      7     ll = l.strip()
      8     if len(ll) == 0:
      9         continue
     10     if l[0].isspace():
     11         last = last + " " + ll
     12         continue
     13     if last:
     14         print(last)
     15     last = ll
     16 
     17 print(last)
     18