Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. scriptSplits = []
  2. actSplits = []
  3.  
  4. curCharacter = None=
  5. curDialog = ""=
  6. for line in scriptLines:=
  7.     if line[0:3] == "ACT":
  8.         if scriptSplits:
  9.             actSplits.append(scriptSplits)
  10.             scriptSplits = []
  11.    
  12.     if line in characters:
  13.         if curCharacter is not None:
  14.             scriptSplits.append((curCharacter, curDialog))
  15.             curDialog = ""
  16.         curCharacter = line
  17.     else:
  18.         curDialog += line + "\n"
  19.    
  20. scriptSplits.append((curCharacter, curDialog))
  21. actSplits.append(scriptSplits)
  22.  
  23. iagoSpeech = ""
  24.  
  25. for act in actSplits:
  26.     print("\tNEW ACT")
  27.     for (speaker, dialog) in act:
  28.         if speaker == "IAGO":
  29.             iagoSpeech += dialog
  30.        
  31. print(iagoSpeech)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement