Search code examples
pythonpy2execx-freeze

How do i convert my Python script (that has imported modules) to a windows exe?


Here are the import modules that my script uses :

import datetime
from dateutil import parser
from tkinter import filedialog
import tkinter
import mailbox
import pprint
import json
import urllib.request
from tkinter import *

#my script code here

How can i convert it into a windows exe. Im using python 3.4. People have suggested cx_freeze however there is no documentation on it therefore have no idea how to use it? Py2exe worked on a test script with no imported modules, but when i tried to compile my script, it didnt work? If my script is called test.py, what would the cx_freeze command be to covnert it?


Solution

  • Try www.py2exe.org/

    py2exe is a nice module that you may find useful.
    Or, if you are in linux/mac then you might try freeze method try https://wiki.python.org/moin/Freeze