title: Python code runs but doesn't execute
body: <p>So basically my code runs, but it doesn't execute properly. I'm not sure what I did wrong. Here's the code. When I type something in the shell, it just ignores it. How would I fix it? I've never really used a <code>if "___name__ == '_main_':</code> function before so would that be why? </p>
  
  <pre><code>import os.path
  import os
  import shutil
  
  def search_files(direct):
      directory=os.path.join(direct)
      directory1=os.path.exists(directory)
      if directory1:
          return directory
      else:
          print ('ERROR')
          direct = input()
  
  def search_characteristics(direct):
      interesting = input()
      space = interesting.count(' ')
      list1 = []
      list2 = []
      list3 = []
      directory = os.path.join(direct)
      files = nested_dir(directory)
      directory1=os.path.exists(directory)
      keyword = interesting[space + 1:len(interesting) + 1]
  
      if interesting[0] == 'N':
          for item in files:
              if item[item.rfind('\\')+1:item.rfind('.')] == interesting[space+1:len(interesting)+1]:
                  list3.append(tem)
                  return list3
  
      elif interesting[0] == 'E' :
          for item in files:
              if item[item.rfind('.')+1:len(item)+ 1] == ((interesting[space:len(interesting)+1]).strip('')).strip('.'):
                  list2.append(item)
                  return list2
  
      elif interesting[0] == 'S' :
          for item in files:
              if int(keyword) &lt;os.path.getsize(item):
                  list1.append(item)
                  return list1
              else:
                  print('ERROR')
  
  def directory_files(nested_directory) -&gt; list:
      file_list = []
      for element in os.listdirectory(nested_directory):
          path = os.path.join(nested_directory,element)
  
          if os.path.isdir(path):
              file_list.extend(nested_directory(path))
          else:
              file_list.append(path)
  
      return file_list
  
  def path(interesting_files):
      for files in interesting_files:
          print(files)
  
  def read_file(interesting_files):
      for files in interesting_files:
          infile=file
          open_file=open(infile)
  
      for line in open_file.readlines():
          print(line)
          open_file.close()
  
  def duplicate(interesting_files):
      for files in interesting_files:
          shutil.copy(files,files+'.dup')
  
  def modify(interesting_files):
      for files in interesting_files:
          os.utime(files,(1330712280, 1330712292))
  
  if __name__ == '_main_':
      while True:
          file_input = input("Enter file name")
          if file_input.lower() == 'p':
              path(operation)
          elif file_input.lower() == 'f':
              read_file(operation)
          elif file_input.lower() == 'd':
              duplicate(operation)
          elif file_input.lower() == 't':
              modify(operation)
          else:
              print('ERROR')
  
      direct = input()
      search_files(direct)
      operation = search_characteristics(direct)
      print(operation)
      operations(operation)
  </code></pre>