3ca079a980
- 中文目录名改为英文:cDNA图像处理实例→examples,参考资料→references - web→app(Flask应用标准命名) - 输出目录平移到 data/output/simple/ 和 data/output/full/ - 输入图像统一到 data/input/ - 构建脚本移到 scripts/ - 源码文件改用 snake_case 命名 - 更新所有文件路径引用和文档
23 lines
624 B
Python
23 lines
624 B
Python
"""cDNA Analyzer 启动器 — 供 PyInstaller 打包"""
|
|
import os, sys, threading
|
|
|
|
# PyInstaller 打包后资源路径
|
|
if getattr(sys, 'frozen', False):
|
|
base = sys._MEIPASS
|
|
else:
|
|
base = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
# 设置模板和静态文件目录
|
|
os.environ['TEMPLATE_DIR'] = os.path.join(base, 'templates')
|
|
os.environ['STATIC_DIR'] = os.path.join(base, 'static')
|
|
|
|
# 导入 Flask app
|
|
from main import app
|
|
|
|
def open_browser():
|
|
os.startfile('http://localhost:5000')
|
|
|
|
if __name__ == '__main__':
|
|
threading.Timer(1.5, open_browser).start()
|
|
app.run(debug=False, port=5000)
|