title: How to Run a Program in Python.
body: <p>I am trying to make a script which would run an .exe file from my computer. I think I am using the wrong command. I tried all the other commands like <code>import os, os.startfile</code>, but they aren't working.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>loop=0
  while loop==0:
      answer=raw_input("coded by: Narralol\n\n"
      "Pick a task:\n"
      "1) Start Minecraft.exe\n"
      "2) Start Minecraft_Server.jar\n"
      "3) Backup your server\n"
      "4) Copy the backup to your desktop\n"
      "5) Exit\n")
      if answer==1:
          execfile('D:\Games\Minecraft\Minecraft.exe')
      elif answer==2:
          execfile('D:\Games\Minecraft\Minecraft_server.jar')
      elif answer==5:
          loop=1
  </code></pre>