Add support run py-script via run.bat

Example: run read_info.py syslog
pull/3/head
remittor 3 years ago
parent 931235aaeb
commit 81677fd24d

@ -1,3 +1,3 @@
@echo off
chcp 866 >NUL
start cmd /k python\python.exe menu.py
@echo off
chcp 866 >NUL
start cmd /k python\python.exe menu.py

@ -739,6 +739,13 @@ class SysLog():
if __name__ == "__main__":
if len(sys.argv) > 1 and sys.argv[1] == 'syslog':
gw = gateway.Gateway(timeout = 4)
if gw.status < 1:
die("Xiaomi Mi Wi-Fi device not found (IP: {})".format(gw.ip_addr))
slog = SysLog(gw, timeout = 10, verbose = 1, infolevel = 2)
sys.exit(0)
fn_dir = ''
fn_old = 'full_info_old.txt'
fn_local = 'full_info.txt'

@ -1,3 +1,11 @@
@echo off
chcp 866 >NUL
python\python.exe menu.py
@echo off
chcp 866 >NUL
if "%~1"=="" goto menu
python\python.exe %*
goto :EOF
:menu
python\python.exe menu.py
goto :EOF

Loading…
Cancel
Save