title: Python - Getting file directory as user input
body: <p>Having some trouble getting a list of files from a user defined directory. The following code works fine:</p>
  
  <pre><code>inputdirectory = r'C:/test/files'
  inputfileextensions = 'txt'
  files = glob.glob(inputdirectory+"*."+inputfileextensions)
  </code></pre>
  
  <p>But I want to allow the user to type in the location. I've tried the following code:</p>
  
  <pre><code>inputdirectory = input("Please type in the full path of the folder containing your files:    ")
  inputfileextensions = input("Please type in the file extension of your files:    ")
  files = glob.glob(inputdirectory+"*."+inputfileextensions)
  </code></pre>
  
  <p>But it doesn't work. No error message occurs, but files returns as empty. I've tried typing in the directory with quotes, with forward and backward slashes but can't get it to work. I've also tried converting the input to raw string using 'r' but maybe by syntax is wrong. Any ideas?</p>