我有 python 应用程序应该作为 Windows 可执行文件启动。我正在使用 py2exe 和 pymssql 1.9.908。
我使用下一个构建脚本来生成应用程序:
from distutils.core import setup
import MySQLdb
import fnmatch
import os
import pymssql
import shutil
import py2exe
import glob
##############
name = 'BGAgent'
old_version = '0.1'
ver = '0.1'
distDir = 'Dist' + name + ver
shutil.rmtree(distDir, True)
shutil.rmtree('Dist' + name + old_version, True)
os.mkdir(distDir)
##############
class Target(object):
""" A simple class that holds information on our executable file. """
def __init__(self, **kw):
""" Default class constructor. Update as you need. …Run Code Online (Sandbox Code Playgroud)