title: Stop music playing with vlc module?
body: <p>I wrote a code that plays song, but i don't know how to stop the song while its playing (i run it with cmd)</p>
  
  <p><strong>This is the code:</strong></p>
  
  <pre><code>import vlc
  
  my_song = vlc.MediaPlayer("path to song")
  
  my_song.play()
  
  while True:
      pass
  </code></pre>
  
  <p>I thought that if i will run another code while the music is playing (in another cmd window) it will stop the song but it is not working. This was the idea:</p>
  
  <pre><code>import vlc
  
  my_song = vlc.MediaPlayer("path to song")
  
  my_song.stop()
  
  while True:
      pass
  </code></pre>
  
  <p>The goal is to play and stop music, i am building a music program. Tnx for help</p>