# call-the-roll **Repository Path**: tieyongjie/call-the-roll ## Basic Information - **Project Name**: call-the-roll - **Description**: 课堂随机点名系统 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-03-14 - **Last Updated**: 2025-04-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 1.创建一个虚拟环境 ```python conda create -n flask python=3.8 ``` ## 2.安装所需的依赖库 ```bash pip install flask pip install pyinstaller ``` ## 3.打包对应为可执行文件 ```bash pyinstaller --onefile app.py ``` 这时候打包的文件汇报错找不到index.html,这是因为默认打包方式没指定html文件 修改app.spec文件,指定模版路径 ```bash # -*- mode: python ; coding: utf-8 -*- a = Analysis( ['app.py'], pathex=[], binaries=[], datas=[('templates/*.html', 'templates')], # 指定模版路径 hiddenimports=[], hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], noarchive=False, optimize=0, ) pyz = PYZ(a.pure) exe = EXE( pyz, a.scripts, a.binaries, a.datas, [], name='app', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, upx_exclude=[], runtime_tmpdir=None, console=True, disable_windowed_traceback=False, argv_emulation=False, target_arch=None, codesign_identity=None, entitlements_file=None, ) ``` 注:尝试将html直接写在app文件中,发现无法文件无法上传成功 ## 4.使用方法 1. 在Windows 双击 app.exe文件 2. 网页打开 http://127.0.0.1:5000 3. 将所需文件拖拽到上面,如:测试文件.xlsx 4.上传完成后点击开始随机点名