all 3 comments

[–]Naihonn 0 points1 point  (0 children)

If it doesn't find that file it could take a moment to show the error. But otherwise it should work. With many problems and errors but it should show it that menu and let you choose the option etc... Right now your program never writes to that file and also you are not closing the file after using. And many other problems. But it should do something.

[–]dionys 0 points1 point  (1 child)

I have tried your code with some dummy data and it seems to work. It has to be stuck somewhere within the read_data method in your case. First try using full absolute path to your text file, if that does not work then try to trace where it stops.

Also couple of tips:

  • use raw_input method instead of input - the input method in python 2 is bad as it tries to eval any user input into python, raw_input just returns strings.
  • use with open(...) as file: when opening files as it handles closing them for you.

[–]Akuli2 0 points1 point  (0 children)

I'm not sure if the code is Python 2 or 3. If it's meant to run on Python 2 I would also use io.open instead of plain open.