title: Building a simple to do list app. I would like to save the lists to a specific directory. Why won't these save to these specified file location?
body: <p>This is a simple to do list application. I would like to save lists, entered by the user, to a directory. How do I save the files to a specified location? The code below creates a file but does not save it to the directory. (Function - newList)</p>
  <pre><code>#Set up Directory
  tdApp = r'C:Program Files\todolistapp'
  if not path.exists(tdApp):
      makedirs(tdApp)
  
  listNames = listdir(tdApp)
  listNames = list(listNames)
  
  #Set up the window
  window = Tk()
  window.title(&quot;To-Do List&quot;)
  window.resizable(width=False, height=False)
  window.geometry(&quot;500x450+500+200&quot;)
  
  #Frame
  appFrame = Frame(window)
  appFrame.pack()
  
  savePath = 'C:\\Apps\\todolistapp\\'
  
  #Define functions
  def newList ():
      task = listEntry.get()
      if task != &quot;&quot;:
          name = task
          filename = &quot;%s.txt&quot; % name
          completeName = &quot;C:\\Apps\\todolistapp\\&quot; + filename
          print(completeName)
          with open(completeName, &quot;w&quot;) as f:
              pass
          tdList.insert(END, task)
          listEntry.delete(0, &quot;end&quot;)
          else:
              messagebox.showwarning(&quot;Warning&quot;, &quot;Please enter a name for your list.&quot;)
  
  #Create entry
  listEntry = Entry(window,
                    width=30)
  listEntry.pack(pady=30)
  
  #Create a frame for buttons
  buttonFrame = Frame(window)
  buttonFrame.pack(pady=30)
  
  #Create buttons
  addListButton = Button(
      buttonFrame,
      text='Add List',
      height=2,
      width=10,
      command= lambda:(newList()) )
  addListButton.grid(row=0, column=0)
  
  window.mainloop()
  </code></pre>