さまざまなフォーラムで同様の問題を見てきましたが、これには当てはまりません。
「main.py」とメイン プログラム「xlsKonverter.py」の 2 つのファイルがあり、cx_freeze を使用して .exe ファイルにコンパイルします。.exe をビルドすると、次のエラー メッセージが表示されます。
pywintypes.error: (110, 'EndUpdateResource', 'The system cannot open the device or file specified.')
そして、(ある程度完成した)ビルドを実行しようとすると、この例外がポップアップします:
すべてのコードをテストしたので、エラーはありません。セットアップ ファイル内のどこかにある必要があります。私が間違っている?そして、良い修正は何ですか?
「セットアップ.py」
これは私の cx_freeze セットアップです
import sys
from cx_Freeze import setup, Executable
build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]}
packages = ['xlrd', 'glob', 'sys']
includes = ['xlsKonverter']
includefiles = []
eggsacutibull = Executable(
script = "main.py",
base = 'Console',
initScript = None,
targetName = "main.py",
compress = True,
copyDependentFiles = True,
appendScriptToExe = False,
appendScriptToLibrary = False,
icon = None
)
setup( name = "Table Converter",
version = "0.3",
author = "Jørgen Sirhaug",
description = "Makes a .csv file from designated Wire List.",
options = {"build_exe": build_exe_options},
executables = [eggsacutibull]
)
「main.py」
、私の主な機能
import xlsKonverter as xk
import os.path
import sys
def main():
fileList = xk.getAllFileURLsInDirectory("C:\\Users\\Jørgen\\Dropbox\\Aker\\Wire Lists\\")
if len(fileList) < 1:
print("ERROR! No files in directory!\nDoes the specified folder excist?")
else:
print('')
for i in range(len(fileList)):
try:
sheet = xk.getWorksheet(fileList[i])
tagCols = xk.automaticFirstRow(sheet)
pairedList = xk.pairCells(sheet, tagCols)
csvString = xk.makecsv(pairedList)#, tagCols)
xk.writeToFile(csvString, i)
except:
print("ERROR!\n" + fileList[i] + '\nThis file does not excist!')
main()
および「xlsKonverter.py」からのインポート
import xlrd
import glob
import sys