Skip to content

Instantly share code, notes, and snippets.

@1694kyle
Created September 23, 2015 23:36
Show Gist options
  • Save 1694kyle/8f082577606a79a0edc4 to your computer and use it in GitHub Desktop.
Save 1694kyle/8f082577606a79a0edc4 to your computer and use it in GitHub Desktop.
cx_freeze setup for scrapy proj
# Description: This is the cx_Freeze setup file for creating an exe program
# =============================================================================
from cx_Freeze import setup, Executable
import platform
# NOTE: you can include any other necessary external imports here as well
if platform.system() == 'Windows':
bse = 'Win32GUI'
else:
bse = None
opts = {'compressed': True,
'create_shared_zip': False,
}
build_exe_options = {
"build_exe": 'Build',
"packages": ["os","twisted","scrapy","yp"],
"includes": ['pkg_resources', 'lxml.etree', 'lxml._elementpath'],
"excludes":['collections.abc', 'scrapy.mail'],
"include_files": [("C:\\Anaconda32\\Lib\\site-packages\\scrapy\\VERSION","VERSION"),
("C:\\Anaconda32\\Lib\\site-packages\\scrapy\\mime.types","mime.types")],
"include_msvcr":True}
exe = Executable(
# what to build
script="main.py", # the name of your build_frame python script goes here
initScript=None,
base="Win32GUI", # if creating a GUI instead of a console app, type "Win32GUI"
targetName="YP_Crawler.exe", # this is the name of the executable file
copyDependentFiles=True,
compress=True,
appendScriptToExe=True,
appendScriptToLibrary=True,
icon=None # if you want to use an icon file, specify the file name here
)
setup(
# the actual setup & the definition of other misc. info
name="YP_Crawler", # program name
version="0.1",
description='Utility to Crawl YellowPages.com',
author="KB",
options={"build_exe": build_exe_options},
executables=[exe]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment