Why Does PyInstaller Hide Your Input Prompt? Debugging and Fixes
This article walks through a common PyInstaller issue where the input dialog disappears in the generated exe, explains why the executable size balloons, and provides a clear code solution and practical tips to resolve the problem.
1. Introduction
Hello, I'm PiPi. Recently a member of the Python community asked why an input dialog does not appear when a Python script is packaged into an exe with PyInstaller.
The question is whether anything special needs to be considered during packaging.
2. Implementation
The original command used was pyinstaller -F xxx.py, but the resulting exe was 90‑110 MB and the input box still did not show.
The following script was provided:
import pandas as pd
from pathlib import Path
p = Path(r"C:\Users\admin\Desktop\代码测试屋子\列转行")
file = p.glob('*.xls*')
file_all = [i for i in file]
n = int(input("请输入要拆分的列数:"))
for i in file_all:
df = pd.read_excel(i)
file_name = p / f"{n}个号码.csv"
(
df.groupby(df.index// n).pipe(lambda x: pd.concat([g.reset_index(drop=True) for _, g in x], axis=1))
).T.to_csv(file_name, index=False)A community member suggested a modification, shown in the image below, which resolved the issue.
3. Conclusion
This article presented a typical PyInstaller packaging problem, explained the cause, and provided a working code solution to ensure the input prompt appears and to keep the executable size reasonable.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Python Crawling & Data Mining
Life's short, I code in Python. This channel shares Python web crawling, data mining, analysis, processing, visualization, automated testing, DevOps, big data, AI, cloud computing, machine learning tools, resources, news, technical articles, tutorial videos and learning materials. Join us!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
