title: Inside Python subtitles to player pysrt and vlc
body: <p>i am trying to make a python program that creates random subtitles every time you see the movie.I use vlc.py 2.2 and pysrt. I want to pass the created subtitles without the need to create a file and then load it.</p>
  
  <p>pysrt.SubRipItems are list like classes, with the inspect.getargspec() function giving me:</p>
  
  <pre><code>ArgSpec(args=['self', 'index', 'start', 'end', 'text', 'position'], varargs=None, keywords=None, defaults=(0, None, None, '', ''))
  </code></pre>
  
  <p>the print() gives me:</p>
  
  <pre><code>1
  00:00:00,100 --&gt; 00:02:18,828
  Hello World!
  </code></pre>
  
  <p>and the type():</p>
  
  <pre><code>class 'str'
  </code></pre>
  
  <p>But no subtitle appear, and no error.</p>
  
  <p>Here is my code until now:</p>
  
  <pre><code>import vlc
  import pysrt
  import inspect
  
  
  file = pysrt.SubRipFile(encoding='utf-8')
  sub = pysrt.SubRipItem(1, start='00:00:0,100', end='00:02:18,828', text="Hello World!")
  file.append(sub)
  
  SubString=str(file[0])
  
  print(SubString)
  print (type(SubString))
  print (inspect.getargspec(pysrt.SubRipItem))
  
  Instance = vlc.Instance()
  player = Instance.media_player_new()
  Media = Instance.media_new('Test.avi')
  player.set_media(Media)
  player.play()
  player.video_set_subtitle_file(SubString)
  </code></pre>