title: Is it possible to make rules for file manager / Python
body: <p>I want to ask is it possible to make a rules for file managing program. For instance, if i want to move certain file in Image folder to move only .png and .img files. How i should declare rule in the configuration file that program would understand? If you would need I would my code gladly upload it. Which libraries i would need to use or give certain examples? Thank you in advance!</p>
  <pre><code>from tkinter import *  
  from tkinter import filedialog
  import easygui
  import shutil
  import os
  from tkinter import filedialog
  from tkinter import messagebox as mb
  from pathlib import Path
  import logging
  from datetime import date
  import configparser
  import configdot
  
  def open_window():
      read=easygui.fileopenbox()
      return read
  
  #logging config
  
  if Path('app.log').is_file():
      print (&quot;Log file already exist&quot;)
  else:
      logging.basicConfig(filename='app.log', filemode=&quot;w&quot;, format='%(name)s - %(levelname)s - %(message)s ')
      print (&quot;Log file doesn't exist, so new one was created&quot;)
  
  
  LOG_for=&quot;%(asctime)s, %(message)s&quot;
  
  logger=logging.getLogger()
  logger.setLevel(logging.DEBUG)
  
  
  # move file function
  def move_file():
      filename = filedialog.askopenfilename(initialdir = config.select.dir,
                                            title = config.select.ttl,
                                            filetypes = config.select.ft)
  
      destination =filedialog.askdirectory()
      dest = os.path.join(destination,filename)
      if(source==dest):
          mb.showinfo('confirmation', &quot;Source and destination are the same, therefore file will be moved to Home catalog&quot;)
          newdestination = Path(&quot;/home/adminas&quot;)
          shutil.move(source, newdestination)
          logging.shutdown()
          logging.basicConfig(filename='app.log', filemode=&quot;a&quot;, format=LOG_for) 
          logging.info('File *' + filename + '* was moved to new destination: ' + newdestination)
          
      else:
          shutil.move(source, destination)  
          mb.showinfo('confirmation', &quot;File Moved !&quot;)
          #current_time()
          logging.basicConfig(filename='app.log', filemode=&quot;a&quot;, format=LOG_for)
          logging.info('File *' + filename + '* was moved to new destination: ' + destination) 
                                                                                                    
  # Create the root window
  window = Tk()
  </code></pre>