zoukankan      html  css  js  c++  java
  • 2018.8.10 programming bat based on python

    @echo off

    REM Current DevProg Version. Match the pip package version (x.y.z)
    SET currentversion=0.4.0

    REM Installation paths. If copying this to a new product, you MUST edit the last parts of venvdir and shortcuts!
    SET basedir=C:GDNVirtualEnvs  // installation file directory
    SET logdir=%basedir%Logs   //debug information
    SET venvdir=%basedir%wifiheater 
    SET scriptdir=%venvdir%Scripts

    SET shortcut=%userprofile%DesktopProgram WifiHeater.lnk
    SET shortcuttargetdir=%scriptdir%program_wifiheater.exe


    if not exist %basedir% (
    mkdir %basedir%  // create file
    )

    if not exist %logdir% (
    mkdir %logdir%
    )

    if not exist %venvdir% (
    python -m venv %venvdir%
    )

    if not exist %scriptdir%activate.bat (
    echo The virtual environment in %venvdir% appears to be invalid.
    echo Delete the folder and run this script again.
    exit /b 1
    )

    call %scriptdir%activate.bat
    pip uninstall -y wifiheater esptool pyserial pyaes ecdsa six
    pip install six-1.10.0-py2.py3-none-any.whl
    pip install ecdsa-0.13-py2.py3-none-any.whl
    pip install pyaes-1.6.1.tar.gz
    pip install pyserial-3.4-py2.py3-none-any.whl
    pip install esptool-2.3.1-py3-none-any.whl
    pip install wifiheater-%currentversion%-py3-none-any.whl

    powershell "$s=(New-Object -COM WScript.Shell).CreateShortcut('%shortcut%');$s.TargetPath='%shortcuttargetdir%';$s.Arguments='program --baud 921600';$s.WorkingDirectory='%logdir%';$s.Save()"

     -----------

  • 相关阅读:
    python函数续
    模拟数据库查询操作
    文件处理
    字符编码
    python函数
    ACM-ICPC 2018 南京赛区网络预赛Skr
    bzoj3676: [Apio2014]回文串 pam
    Wannafly挑战赛23B游戏
    bzoj4804: 欧拉心算 欧拉筛
    bzoj3884: 上帝与集合的正确用法 扩展欧拉定理
  • 原文地址:https://www.cnblogs.com/huangbaobaoi/p/9456740.html
Copyright © 2011-2022 走看看