title: Creating a Python Command Prompt
body: <p>I am currently making a python program that will execute commands to the command prompt via the os import. I want it to show the current file directory like the normal command prompt does, but I can't manage to do that. It only shows the directory that the program is located at. If I try changing directories via the cd command while running the python cmd, it doesn't change directories.</p>
  
  <p>How can I use the cd command with my python command prompt and have it show the directory that I'm currently in (not the one the program was run from)?</p>
  
  <pre><code>import os
  
  def main():
      input = raw_input("\n" + os.getcwd() + "&gt;")
      execute(input)
  
  def execute(c):
      os.system(c)
      main()
  
  print("--Python Command Prompt--")
  os.system("color c");
  main()
  </code></pre>