title: How can I open files in external programs in Python?
body: <p>I'm wondering how to open files in programs such as Notepad and Picture Viewer depending on the extension the file has. I'm using Python 3.3 on Windows.</p>
  
  <p>I've done some research and people have mentioned a module named <code>Image</code>, but when I try and import this module I get an ImportError.</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>def openFile():
      fileName = listbox_1.get(ACTIVE)
      if fileName.endswith(".jpg"):
          fileName.open()
  </code></pre>
  
  <p>I will also have HTML and JSON files that I will need to open in Notepad.</p>