Every line of 'export pythonpath' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
27 def export_py(): 28 global proto_path 29 global protoc_path 30 31 # protoc 生成py时,必须将当前目录改到proto所在目录,参数中路径必须用相对路径 32 os.chdir(proto_path) 33 34 for file in os.listdir(proto_path): 35 if file[-6:] == ".proto" and os.path.isfile(os.path.join(proto_path,file)): 36 cmd = "{0} --python_out={1} {2}".format(protoc_path,"./../output/python",file) 37 os.system(cmd) 38 39 pass