def main(): global listen global port global execute global command global upload_destination global target if not len(sys.argv[1:]): usage() try: opts,args=getopt.getopt(sys.argv[1:],"hle:t:p:cu",["help","listen","execute","target","port","command","upload"]) except getopt.GetoptError as err: print str(err) usage() for o,a in opts: if o in ("-h","--help"): usage() elif o in ("-l","--listen"): listen = True elif o in ("-e","--excute"): execute = a elif o in ("-c","--commandshell"): command = True elif o in ("-u","--upload"): upload_destination = a elif o in ("-t","--target"): target = a elif o in ("-p","--port"): port = int(a) else: assert False,"Unhandled Option" if not listen and len (target) and port > 0: buffer = sys.stdin.read() client_sender(buffer) if listen: server_loop() main() def client_sender(buffer): pass def server_loop(): pass
python
原创
©著作权归作者所有:来自51CTO博客作者lijingsan1的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
PythonPython
-
No Python at no Python at d
运行项目出现错误:No Python at ‘D:\Python\python.exe’
python pycharm Python 新版本