Your problem is that you are trying to compile your script using IDLE. When you are using py2exe
, you have to do it a little bit different.
If you've used Disutils before, you might have seen this:
python setup.py install
The same way you're using py2exe. So type in cmd:
python untitled-22.py py2exe
And it should work. BTW I recommend you reading this tutorial at py2exe.org.