Ai
3 Star 1 Fork 1

liuliu9520/tinycom

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
tinycom.py 1.81 KB
一键复制 编辑 原始数据 按行查看 历史
fengyuan 提交于 2020-03-18 14:52 +08:00 . 修改了软件说明信息的print方式
#!/usr/bin/python
#
# tinycom.py
#
# --powered by liuyajun(20200316)
#################################################################
import os,sys
import serial
import threading
import serial
from tqdm import tqdm
from pathlib import Path
#sys.path[0]
#os.getcwd()
curpath = sys.path[0];
#################################################################
InfoHead = '''
########################################################################
Tinycom :
tinycom is a software for downloading files and communication
based on SCI interface.
-cfg: configure communication parameters and download file list.
-sf: download file.
-com: communication.
-help: help info
-ec / -exit / ctrl+d: exit procedure [tinycom | tinycom-sf | tinycom-com]
########################################################################"
'''
if __name__ == "__main__":
print InfoHead
#os.path.abspath('.');
try:
while True:
cmdstr = raw_input("Tinycom>: ");
cmdstr = cmdstr.strip("\n");
if cmdstr == "-cfg":
os.system("sudo \"" + curpath + "/tinycom_cfg.sh\"");
if cmdstr == "-sf":
os.system("sudo \"" + curpath + "/tinycom_sf.sh\"");
if cmdstr == "-com":
os.system("sudo python \"" + curpath + "/tinycom_com.py\"");
if cmdstr == "-help":
print " -cfg configure communication parameters and download file list.";
print " -sf download file.";
print " -com communication.";
print " -help help info";
print " -ec terminate communication";
print " -ec / -exit / ctrl+d: exit procedure [tinycom | tinycom-sf | tinycom-com]"
if cmdstr == "-exit":
print "# END-tinycom"
break;
if cmdstr == "-ec":
print "# END-tinycom"
break;
#else:
# print " [",cmdstr,"]"" is not an option for tinycom!"
except:
print "# END-tinycom"
exit();
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/liuliu9520/tinycom.git
git@gitee.com:liuliu9520/tinycom.git
liuliu9520
tinycom
tinycom
master

搜索帮助