title: Find a directory containing desired text and stored all that files into another folder
body: <p>How can we identify files of desired text in a file of the same directory and then separate all those files into another directory?</p>
  <pre><code>import os
  user_input = input('What is the name of your directory')
  directory = os.listdir(user_input)
  searching = input('What word are you trying to find?')
  for fname in directory:
      if os.path.isfile(user_input + os.sep + fname):
          # Full path
          f = open(user_input + os.sep + fname, 'r')
  
          if searching in f.read():
              print('found string in file %s' % fname)
          else:
              print('string not found')
          f.close()
  </code></pre>