小编Sar*_*rah的帖子

为什么我的argparse系统出现系统出口2错误?

这是我编码的主要部分.当我运行我的整个代码集时,它显示在此段中发生了异常:"options = parse.parse_args()"中的SystemExit2错误.我可以知道这里出了什么问题吗?

import argparse
import queue
import roypy
from sample_camera_info import print_camera_info
from roypy_sample_utils import CameraOpener, add_camera_opener_options
from roypy_platform_utils import PlatformHelper

class MyListener (roypy.IRecordStopListener):
   """A simple listener, in which waitForStop() blocks until onRecordingStopped has been called."""
   def __init__ (self):
       super (MyListener, self).__init__()
       self.queue = queue.Queue()

   def onRecordingStopped (self, frameCount):
       self.queue.put (frameCount)

   def waitForStop (self):
       frameCount = self.queue.get()
       print ("Stopped after capturing {frameCount} frames".format (frameCount=frameCount))

def main ():
    platformhelper = PlatformHelper() 
    parser = argparse.ArgumentParser (usage = __doc__)
    add_camera_opener_options (parser)
    parser.add_argument …
Run Code Online (Sandbox Code Playgroud)

python cpu-word argparse

6
推荐指数
1
解决办法
1271
查看次数

标签 统计

argparse ×1

cpu-word ×1

python ×1