tkinter entry to function

Hi
i'm totally new to python and I'm trying to make an easy GUI with tkinter that should take a name of a textfile in an entry widget, and when you click a button the text in the entry should be passed to a function handling the file.
This is a snippet of my code:

The problem is that the file2List function checks if the file passed exists, and produce an error if it doesn't.
This error now shows as soon as I run the program, not after passing a faulty filename.
So, how do prevent the function being run until i click the button?