I know there's already a question like this, but I got this error when I used it:
Traceback (most recent call last):
File "C:/Users/rperera/PycharmProjects/PythonToExe/test.py", line 12, in <module>
save_path = filedialog.asksaveasfilename(defaultextension="*.exe", filetypes=("Executable File", "*.exe"))
File "C:\Python34\lib\tkinter\filedialog.py", line 380, in asksaveasfilename
return SaveAs(**options).show()
File "C:\Python34\lib\tkinter\commondialog.py", line 48, in show
s = w.tk.call(self.command, *w._options(self.options))
_tkinter.TclError: bad file type "*.exe", should be "typeName {extension ?extensions ...?} ?{macType ?macTypes ...?}?"
Can anyone help me on how to fix this? Here's my code:
from distutils.core import setup
import py2exe, sys
import tkinter as tk
from tkinter import filedialog
input('Press Enter to continue and select your Python file you want to convert when the dialog shows up...')
tk.Tk().withdraw()
file_path = tk.filedialog.askopenfilename()
sys.argv.append("py2exe")
input("Press Enter to continue and choose where you want to save the new executable file when the dialog shows up...")
save_path = filedialog.asksaveasfilename(defaultextension="*.exe", filetypes=("Executable File", "*.exe"))
setup(console=[file_path], options={'py2exe': {'compressed': 1, 'bundle_files': 1, 'dist_dir': save_path + "dir"}})