vec2bin.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:hadan-gcloud 作者: youkpan 项目源码 文件源码
def main(argv):
   inputfile = False
   outputfile = False
   try:
      opts, args = getopt.getopt(argv,"hi:o:",["ifile=","ofile="])
   except getopt.GetoptError:
      print('vec2bin.py -i <inputfile> -o <outputfile>')
      sys.exit(2)
   for opt, arg in opts:
      if opt == '-h':
         print('test.py -i <inputfile> -o <outputfile>')
         sys.exit()
      elif opt in ("-i", "--ifile"):
         inputfile = arg
      elif opt in ("-o", "--ofile"):
         outputfile = arg

   if not inputfile or not outputfile:
       print('vec2bin.py -i <inputfile> -o <outputfile>')
       sys.exit(2)

   print('Converting %s to binary file format' % inputfile)
   vec2bin(inputfile, outputfile)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号