python - pyinstaller制作exe文件后程序不起作用
问题描述
我使用 numpy、sympy、sys 制作了一个 Python 程序,它在 IDE 中运行良好。这是代码...
import numpy as np
from sympy import *
import sys
f = open("result.txt", 'w+')
for line in sys.stdin:
f.write(line)
f.close()
f = open("result.txt", 'r')
data = f.read().split("\n")
i = 0
while i < len(data):
data[i] = data[i].split(' ')
i += 1
print(data)
amount = int(data[0][0])
print(amount)
matrix = np.zeros((amount, amount))
i = 0
j = 0
while i < amount:
while j < amount:
matrix[i, j] = int(data[i + 1][j])
j += 1
j = 0
i += 1
i = 0
j = 0
counter = 0
formula = 1
while i < amount:
while j < amount:
if matrix[i, j] == 1:
x = symbols(str(i + 1))
y = symbols(str(j + 1))
if counter == 0:
formula = (~x | ~y)
counter += 1
else:
formula = formula & (~x | ~y)
j += 1
j = 0
i += 1
formula_to_string = pycode(simplify_logic(formula, form='dnf', force=True))
massive_to_parse = formula_to_string.split("or")
k = 1
i = 0
while i < len(massive_to_parse):
print("{", end='')
while k < amount + 1:
try:
massive_to_parse[i].index(str(k))
except ValueError:
print("V",k, sep='', end='')
finally:
k += 1
print("}-максимальное внутренне устойчивое множество")
k = 1
i += 1
然后我用这个命令使用pyinstaller制作了一个exe文件......
pyinstaller main.py
我该如何解决这个问题?因为我需要大学的 exe 文件才能从 C 上的其他程序启动它
解决方案
推荐阅读
- android - AndroidStuidio:未启用 EditText 上的触摸
- node.js - Redis CPU 消耗问题
- rust - 为什么必须在结构中创建泛型类型的无用字段?
- r - 无法在 R 版本 4.0.5 中安装 ggtree
- python - 从 FastAPI 的 fileResponse 读取响应?
- javascript - 当源来自外国服务器时获取 Iframe innerHTML
- javascript - javascript分块文件上传的巨大内存消耗(应该是内存高效的)
- javascript - 具有动态限制的分页问题
- python - Django 模型:创建模型条目的变体并与原始条目进行比较
- javascript - 显示在 pdf 文件中的 javascript blob 名称