Python filecmp.cmp('old_index.html', 'new_index.html') in if event
Question: how can I make this python command in a if question:

    
    
    import filecmp
    filecmp.cmp('old_index.html', 'new_index.html')
    

the answer from these command is True or False. So that I can execute
something when the files are the same or when they are not.

Thanks for your help


Answer: You can simply use that in an `if` statement, like this

    
    
    if filecmp.cmp('old_index.html', 'new_index.html'):
        # Do whatever you want if the files are the same
        print("Both the files are same")
    else:
        # Do whatever you want if the files are NOT the same
        print("No, the files are NOT the same")
    

