I know how to generate proto files in C #
- open visual studio, open nuget command line, type: Install-Package Google.ProtocolBuffers , link: Google.ProtocolBuffers 2.4. 1.555
- find package /Google.ProtocolBuffers.2.4.1.555/tools/ProtoGen.exe
- use the command line, enter: ProtoGen.exe addressbook.proto -output_directory = C: \ trash
I am writing a python script in proto proto gen.py files
import os, subprocess, threading def main(): with open("conf.txt") as file: exe = os.path.join(os.getcwd(), "..\\Package\\Google.ProtocolBuffers.2.4.1.555\\tools\\ProtoGen.exe") out = "-output_directory=%s" % (os.path.join(os.getcwd(), "..\\Common\\libs\\protos")) def gen(proto): subprocess.check_call([exe, os.path.join("protos", proto), out]) list = [] for proto in file.read().split(','): t = threading.Thread(target = gen, args = (proto, )) t.start() list.append(t) for t in list: t.join() if __name__ == '__main__': main()
conf.txt
base.proto,test.proto,addressbook.proto
source share