if DEBUG:
if len(sys.argv) == 2:
cmd_str = 'python %s -keypad --debug' % prog_name
p1 = subprocess.Popen(cmd_str, shell=True)
cmd_str = 'python %s -lcd --debug' % prog_name
p2 = subprocess.Popen(cmd_str, shell=True)
elif len(sys.argv) == 3:
if sys.argv[1] == '-keypad':
arobot_main('keypad')
elif sys.argv[1] == '-lcd':
arobot_main('lcd')
else:
usage()
else:
if len(sys.argv) == 1:
# Do not wast your time on threading, it is disaster working with tk!
# I have tried many ways to open multi-windows via Tk and Threading
# but fail! or linux ok but windows fail, so, just use the subprocess!
cmd_str = 'python %s -keypad' % prog_name
p1 = subprocess.Popen(cmd_str, shell=True)
cmd_str = 'python %s -lcd' % prog_name
p2 = subprocess.Popen(cmd_str, shell=True)
elif len(sys.argv) == 2:
if sys.argv[1] == '-keypad':
arobot_main('keypad')
elif sys.argv[1] == '-lcd':
arobot_main('lcd')
else:
usage()
else:
usage()
--------------------------------------分割线 --------------------------------------
CentOS上源码安装Python3.4
《Python核心编程 第二版》.(Wesley J. Chun ).[高清PDF中文版]
《Python开发技术详解》.( 周伟,宗杰).[高清PDF扫描版+随书视频+代码]
在Ubuntu下用Python搭建桌面算法交易研究环境