Guest User

Untitled

a guest
Apr 24th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. s = ' playsound3Dwhenpossible(soundspotpoint18, %$videos_sounds_path%/sounds/lavazza_-_auguri_cherubini__15_.mp3, true, false, -52.644483, 0.947368, 90, 1, spotpoint18);'
  2. x = s.split("(")
  3. print(x)
  4.  
  5. x = s.split("?=(")
  6.  
  7. def split_keep_separator(source, sep):
  8. elements = source.split(sep)
  9. return [e for t in zip(elements, [sep] * (len(elements))) for e in t][:-1]
  10.  
  11. s = ' playsound3Dwhenpossible(soundspotpoint18, %$videos_sounds_path%/sounds/lavazza_-_auguri_cherubini__15_.mp3, true, false, -52.644483, 0.947368, 90, 1, spotpoint18);'
  12.  
  13. x = split_keep_separator(s, "(")
  14. print(x)
  15.  
  16. # [' playsound3Dwhenpossible',
  17. # '(',
  18. # 'soundspotpoint18, %$videos_sounds_path%/sounds/lavazza_-_auguri_cherubini__15_.mp3, true, false, -52.644483, 0.947368, 90, 1, spotpoint18);']
  19.  
  20. import re
  21. s = ' playsound3Dwhenpossible(soundspotpoint18, %$videos_sounds_path%/sounds/lavazza_-_auguri_cherubini__15_.mp3, true, false, -52.644483, 0.947368, 90, 1, spotpoint18);'
  22. x = re.split(r'(()', s)
Add Comment
Please, Sign In to add comment