1 Star 1 Fork 1

python_Project/exe_python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
demo.py 8.02 KB
一键复制 编辑 原始数据 按行查看 历史
huangjian 提交于 2021-03-18 20:38 . python run local exe
# coding:utf-8
import os
from flask import Flask ,redirect,render_template
from application import Application
appstart = Application()
app = Flask(__name__
# static_url_path="/static", # 访问静态资源的url前缀,默认值为static
# static_folder="static", # 静态文件的目录,默认是static
# template_folder="templates", # 模板文件的目录,默认是templates
) # 模块名,flask以这个模板所在的目录为总目录
# 配置参数的使用方式:
# 1.使用配置文件
# app.config.from_pyfile("config.cfg")
# 2.使用对象配置参数
# class Config(object):
# DEBUG = True
# app.config.from_object(Config)
# 3. 直接操作config的字典对象
# app.config["DEBUG"] = True
@app.route("/") # 带参装饰器 / 与下面视图函数绑定
def index():
"""定义的视图函数"""
return render_template("index.html")
@app.route("/NX7000") # 带参装饰器 / 与下面视图函数绑定
def NX7000():
"""定义的视图函数"""
# return "hello flask"
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\NX-7000\\writeProdID.exe')
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\KYEMouse\\KYEMouse.exe /m')
# return redirect('/')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
@app.route("/NX7008") # 带参装饰器 / 与下面视图函数绑定
def NX7008():
"""定义的视图函数"""
# return "hello flask"
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\NX-7008\\writeProdID.exe')
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\KYEMouse\\KYEMouse.exe /m')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
@app.route("/NX7010") # 带参装饰器 / 与下面视图函数绑定
def NX7010():
"""定义的视图函数"""
# return "hello flask"
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\NX-7010\\writeProdID.exe')
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\KYEMouse\\KYEMouse.exe /m')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
@app.route("/NX7015") # 带参装饰器 / 与下面视图函数绑定
def NX7015():
"""定义的视图函数"""
# return "hello flask"
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\NX-7015\\writeProdID.exe')
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\KYEMouse\\KYEMouse.exe /m')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
@app.route("/NX7020") # 带参装饰器 / 与下面视图函数绑定
def NX7020():
"""定义的视图函数"""
# return "hello flask"
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\NX-7020\\writeProdID.exe')
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\KYEMouse\\KYEMouse.exe /m')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
@app.route("/ECO7000") # 带参装饰器 / 与下面视图函数绑定
def ECO7000():
"""定义的视图函数"""
# return "hello flask"
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\ECO-7000\\writeProdID.exe')
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\KYEMouse\\KYEMouse.exe /m')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
@app.route("/ECO8015") # 带参装饰器 / 与下面视图函数绑定
def ECO8015():
"""定义的视图函数"""
# return "hello flask"
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\ECO-8015\\writeProdID.exe')
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\KYEMouse\\KYEMouse.exe /m')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
@app.route("/ECO8100") # 带参装饰器 / 与下面视图函数绑定
def ECO8100():
"""定义的视图函数"""
# return "hello flask"
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\ECO-8100\\writeProdID.exe')
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\KYEMouse\\KYEMouse.exe /m')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
@app.route("/XG600") # 带参装饰器 / 与下面视图函数绑定
def XG600():
"""定义的视图函数"""
# return "hello flask"
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\XG-600\\X-G600_TXID.exe')
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\KYEMouse\\KYEMouse.exe /m')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
@app.route("/i608x") # 带参装饰器 / 与下面视图函数绑定
def i608x():
"""定义的视图函数"""
# return "hello flask"
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\pen\\I608X\\TabletTest.exe')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
@app.route("/i405x") # 带参装饰器 / 与下面视图函数绑定
def i405x():
"""定义的视图函数"""
# return "hello flask"
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\pen\\I405X\\TabletTest.exe')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
@app.route("/kyemouse") # 带参装饰器 / 与下面视图函数绑定
def kyemouse():
"""定义的视图函数"""
# return "hello flask"
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\mouse\\programs\\KYEMouse\\KYEMouse.exe /m')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
@app.route("/keyboard") # 带参装饰器 / 与下面视图函数绑定
def keyboard():
"""定义的视图函数"""
# return "hello flask"
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\Keyboard\\键盘TEST.EXE')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
@app.route("/cameratest") # 带参装饰器 / 与下面视图函数绑定
def cameratest():
"""定义的视图函数"""
# return "hello flask"
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\KyeTool\\camera\\camera.exe')
appstart.execAppByCmd(r'start C:\\Progra~2\\Audacity\\audacity.exe')
os.chdir(r'D:\\昆盈QC測試軟件\\KyeTool\\camera')
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\KyeTool\\camera\\Alcor_Camera_Test.exe')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
@app.route("/AlcorQC") # 带参装饰器 / 与下面视图函数绑定
def AlcorQC():
"""定义的视图函数"""
os.chdir(r'D:\\昆盈QC測試軟件\\Alcor\\安國QC測試程式\\UFD_AlcorQC_v2.0.1.33-LOC_XP2K_Setup')
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\Alcor\\安國QC測試程式\\UFD_AlcorQC_v2.0.1.33-LOC_XP2K_Setup\\AlcorQC.exe')
# appstart.execAppByCmd(r'start D:\\UFD_AlcorQC_v2.0.1.33-LOC_XP2K_Setup\\AlcorQC.exe')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
@app.route("/PrintPro") # 带参装饰器 / 与下面视图函数绑定
def PrintPro():
"""定义的视图函数"""
os.chdir(r'D:\\昆盈QC測試軟件\\Alcor\\安國掃碼程式\\PrintPro')
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\Alcor\\安國掃碼程式\\PrintPro\\PrintPro.exe')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
@app.route("/usbclean") # 带参装饰器 / 与下面视图函数绑定
def usbclean():
"""定义的视图函数"""
os.chdir(r'D:\\昆盈QC測試軟件\\Alcor\\newUsbClean')
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\Alcor\\newUsbClean\\drivecleanup1.40\\x64\\DriveCleanup.exe')
appstart.execAppByCmd(r'start D:\\昆盈QC測試軟件\\Alcor\\newUsbClean\\usboblivion-1.11.3.0\\usboblivion64.exe -enable -auto -nosave')
appstart.execAppByCmd(r'shutdown -f -r -t 000')
return redirect('https://meeting.geniusnet.com.cn/kyetest/index.html')
if __name__ == '__main__':
app.run()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/python_-project/exe_python.git
git@gitee.com:python_-project/exe_python.git
python_-project
exe_python
exe_python
master

搜索帮助