title: How to open external programs in Python
body: <p>Duplicate edit: no, i did that but it doesnt want to launch firefox.
  I am making a cortana/siri assistant thing, and I want it to lets say open a web browser when I say something. So I have done the if part, but I just need it to launch firefox.exe I have tried different things and I get an error . Here is the code. Please help! It works with opening notepad but not firefox..</p>
  
  <pre><code>#subprocess.Popen(['C:\Program Files\Mozilla Firefox\firefox.exe']) opens the app and continues the script
  #subprocess.call(['C:\Program Files\Mozilla Firefox\firefox.exe']) this opens it but doesnt continue the script
  
  import os
  import subprocess
  
  print "Hello, I am Danbot.. If you are new ask for help!" #intro
  
  prompt = "&gt;"     #sets the bit that indicates to input to &gt;
  
  input = raw_input (prompt)      #sets whatever you say to the input so bot can proces
  
  raw_input (prompt)     #makes an input
  
  
  if input == "help": #if the input is that
   print "*****************************************************************" #says that
   print "I am only being created.. more feautrues coming soon!" #says that
   print "*****************************************************************" #says that
   print "What is your name talks about names" #says that
   print "Open (name of program) opens an application" #says that
   print "sometimes a command is ignored.. restart me then!"
   print "Also, once you type in a command, press enter a couple of times.."
   print "*****************************************************************" #says that
  
  raw_input (prompt)     #makes an input
  
  if input == "open notepad": #if the input is that
   print "opening notepad!!" #says that
   print os.system('notepad.exe') #starts notepad
  
  if input == "open the internet": #if the input is that
   print "opening firefox!!" #says that
   subprocess.Popen(['C:\Program Files\Mozilla Firefox\firefox.exe'])
  </code></pre>