SHARE
TWEET

Untitled

a guest Mar 4th, 2018 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from wakabaparser import PTODel
  2.  
  3. line = r"""Lorem ipsum^H^H^H dolor sit^H^H amet"""
  4. tokens = line.split('^H')
  5. print(tokens)
  6. nodes = []
  7. string = tokens.pop(0)
  8. while tokens:
  9.     node = []
  10.     tdel = 1
  11.     nstring = tokens.pop(0)
  12.     while nstring is '':
  13.         tdel += 1
  14.         nstring = tokens.pop(0)
  15.     node.append(string[-tdel:])
  16.     nodes.append(string[:-tdel])
  17.     nodes.append(PTODel(node))
  18.     string = nstring
  19.     if len(tokens) is 0:
  20.         nodes.append(string)
  21.     print(nodes)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top