forked from ryjfgjl/DiLuConverter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
66 lines (51 loc) · 2.03 KB
/
setup.py
File metadata and controls
66 lines (51 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
from cx_Freeze import setup, Executable
import os
import sys
os.environ['TCL_LIBRARY']=r"C:\Program Files\Python37\tcl\tcl8.6"
os.environ['TK_LIBRARY']=r"C:\Program Files\Python37\tcl\tk8.6"
# Dependencies are automatically detected, but it might need
# fine tuning.
base = None
# 判断Windows系统
#if sys.platform == 'win32':
# base = 'Win32GUI'
packages = ["os", "numpy", "pymysql", "pandas", "numpy", "chardet", "openpyxl"]
for dbmodule in ['win32gui','win32api' ,'win32con' , 'cx_Freeze']:
try:
__import__(dbmodule)
except ImportError:
pass
else:
packages.append(dbmodule)
options = {
'build_exe':
{
'includes': 'atexit'
# 依赖的包
,"packages": packages
# 额外添加的文件
, 'include_files':['config.ini', "common", "test", "README.md", "events", "gui"
, "site-packages"]
}
}
executables = [
Executable(
# 工程的 入口
'main.py'
, base=base
# 生成 的文件 名字
, targetName = 'ExcelToDatabase.exe'
# 生成的EXE的图标
, icon = 'excel.ico' #图标, 32*32px
)
]
setup(
# 产品名称
name='ExcelToDatabase',
# 版本号
version='4.1',
# 产品说明
description='Import excel to mysql automaticly',
options=options,
executables=executables
)