0

我正在开发一些伪 GUI 应用程序(基于 thinker),我需要创建可执行的 Windows Installer。我创建的主要功能只是创建记录器和输入小部件。

import logging
import sys
import os
import datetime

import InputWidget

logger = logging.getLogger("xxx")


def main():
    filename = "xxx" + datetime.datetime.now().strftime('%Y-%m-%d-%H.%M.%S') + ".log"

    log_file = os.path.abspath(os.path.join('logs',filename))

    logging.basicConfig(filename=log_file,
                        filemode='a',
                        format='%(asctime)s:%(msecs)d %(levelname)s %(name)s \t %(message)s',
                        datefmt='%H:%M:%S',
                        level=logging.DEBUG)

    logger.info("Start application")


    widget = InputWidget.InputWidget()
    widget.run()

然后我按照这个例子创建了installer.cfg文件

[Application]
name=xxx
version=1.0
entry_point=main:main
icon=config/Stopwatch.ico
console=true

[Python]
version=2.7.14
bitness=64

[Include]
# Importable packages that your application requires, one per line
packages = src
    future
    gspread
    impala
    mistune
    numpy
    oauth2client
    pandas

pypi_wheels = google-api-python-client==1.6.4
    PyDrive==1.3.1
    Pygments==2.2.0
    pygsheets==1.1.3

# Other files and folders that should be installed
files = config\
    logs\

但是安装后,windows找不到python。如何指定python安装点?
你能告诉我如何导出环境变量吗?如何改进我的installer.cfg文件?

使用 pynsist 作为部署工具是个好主意吗?也许你有更好的建议?

4

0 回答 0