HELP!!! Python error too few arguments /u/Trickd122 Python Education

Im trting to run a script from github issue is it keeps giving the error too few arguments see below

# EEPROM encode options

eeprom_encode = subparsers.add_parser(“eeprom_encode”, help=”EEPROM – encode from a protobuf”)

eeprom_encode.add_argument(“-t”, “–machine-type”, action=”store”, choices=machine.get_machine_types(), help=”Machine type (Fox T-class, Prodigy P-class, Quantum, uPrint, uPrint SE)”, required=True)

eeprom_encode.add_argument(“-e”, “–eeprom-uid”, action=”store”, dest=”eeprom_uid”, required=True, help=”Format: [a-f0-9]{14}23, example: 11010a01ba325d23″)

eeprom_encode.add_argument(“-D”, “–diag-format”, action=”store_true”, dest=”diag_format”, help=”Produce output in the ASCII format used over the printer diagnostic port”)

eeprom_encode.add_argument(“-a”, “–use-ascii”, action=”store_true”, dest=”use_ascii”, help=”Use ASCII format for output file”)

eeprom_encode.add_argument(‘input_file’, nargs=’?’, type=argparse.FileType(‘r’), default=sys.stdin)

eeprom_encode.add_argument(‘output_file’, nargs=’?’, type=argparse.FileType(‘w’), default=sys.stdout)

eeprom_encode.set_defaults(func=self.command_eeprom_encode)

# EEPROM decode options

eeprom_decode = subparsers.add_parser(“eeprom_decode”, help=”EEPROM – decode from a binary dump”)

eeprom_decode.add_argument(“-t”, “–machine-type”, action=”store”, choices=machine.get_machine_types(), help=”Machine type (Fox T-class, Prodigy P-class, Quantum, uPrint, uPrint SE)”, required=True)

eeprom_decode.add_argument(“-e”, “–eeprom-uid”, action=”store”, dest=”eeprom_uid”, required=True, help=”Format: [a-f0-9]{14}23, example: 11010a01ba325d23″)

eeprom_decode.add_argument(“-D”, “–diag-format”, action=”store_true”, dest=”diag_format”, help=”Read input in the ASCII format used over the printer diagnostic port”)

eeprom_decode.add_argument(‘input_file’, nargs=’?’, type=argparse.FileType(‘r’), default=sys.stdin)

eeprom_decode.add_argument(‘output_file’, nargs=’?’, type=argparse.FileType(‘w’), default=sys.stdout)

eeprom_decode.set_defaults(func=self.command_eeprom_decode)

# EEPROM create options

eeprom_create = subparsers.add_parser(“eeprom_create”, help=”EEPROM – create a cartridge”)

eeprom_create.add_argument(“-m”, “–material-name”, action=”store”, type=str, dest=”material_name”, help=”Run “stratatools-cli.py material –list” for a list of known material”)

eeprom_create.add_argument(“-l”, “–manufacturing-lot”, action=”store”, type=str, dest=”manufacturing_lot”, help=”Format [0-9]{4}, examples: 1234 – 0000 – 9999″)

eeprom_create.add_argument(“-d”, “–manufacturing-date”, action=”store”, type=self.parse_date, dest=”manufacturing_date”, help=”Format “yyyy-mm-dd hh:mm:ss”, examples: “2014-01-01 13:14:15″”)

eeprom_create.add_argument(“-u”, “–use-date”, action=”store”, type=self.parse_date, dest=”use_date”, help=”Format “yyyy-mm-dd hh:mm:ss”, examples: “2014-01-01 13:14:15″”)

eeprom_create.add_argument(“-n”, “–initial-material”, action=”store”, type=float, dest=”initial_material_quantity”, help=”Unit: cubic inches, format [0-9]{1,}.[0-9]{1,}, examples: 91.5 – 100.0 – 0.123456789″)

eeprom_create.add_argument(“-c”, “–current-material”, action=”store”, type=float, dest=”current_material_quantity”, help=”Unit: cubic inches, format [0-9]{1,}.[0-9]{1,} examples: 91.5 – 100.0 – 0.123456789″)

eeprom_create.add_argument(“-k”, “–key-fragment”, action=”store”, dest=”key_fragment”, help=”Format [a-f0-9]{16}, examples: abcdef0123456789″)

eeprom_create.add_argument(“-s”, “–serial-number”, action=”store”, type=float, dest=”serial_number”, help=”Format: [0-9]{1,}.0, example: 1.0 – 123456789.0 – 413203.0″)

eeprom_create.add_argument(“-v”, “–version”, action=”store”, type=int, dest=”version”, help=”Format: [0-9]{1}, examples: 0 – 1″)

eeprom_create.add_argument(“-g”, “–signature”, action=”store”, type=str, default=”STRATASYS”, dest=”signature”, help=”Format: [a-z]{0,9}, examples: STRATASYS – MYOWNSIG – EMPTY”)

eeprom_create.add_argument(‘input_file’, nargs=’?’, type=argparse.FileType(‘r’), default=sys.stdin)

eeprom_create.add_argument(‘output_file’, nargs=’?’, type=argparse.FileType(‘w’), default=sys.stdout)

eeprom_create.set_defaults(func=self.command_eeprom_create)

# SetupCode create options

setupcode_create = subparsers.add_parser(“setupcode_create”, help=”SetupCode – create a setup code from arguments”)

setupcode_create.add_argument(“-n”, “–serial-number”, action=”store”, dest=”serial_number”)

setupcode_create.add_argument(“-s”, “–system-type”, action=”store”, dest=”system_type”, choices=SystemType.all())

setupcode_create.add_argument(“-t”, “–type”, action=”store”, dest=”code_type”, choices=CodeType.all())

setupcode_create.add_argument(“-l”, “–envelope-size”, action=”store”, dest=”envelope_size”, choices=EnvelopeSize.all())

setupcode_create.add_argument(“-b”, “–build-speed”, action=”store”, dest=”build_speed”, choices=BuildSpeed.all())

setupcode_create.add_argument(“-m”, “–material”, action=”store”, dest=”material”, nargs=”+”, type=str, choices=CodeMaterial.all())

setupcode_create.add_argument(“-v”, “–version”, action=”store”, dest=”version”)

setupcode_create.add_argument(“-k”, “–key”, action=”store”, dest=”key”, type=int, default=0)

setupcode_create.set_defaults(func=self.command_setupcode_create)

# SetupCode decode options

setupcode_decode = subparsers.add_parser(“setupcode_decode”, help=”SetupCode – print information about a setup code”)

setupcode_decode.add_argument(“setup_code”, action=”store”)

setupcode_decode.set_defaults(func=self.command_setupcode_decode)

#

# Material options

#

material_parser = subparsers.add_parser(“material”, help=”Material supported by stratasys”)

material_parser.add_argument(“-l”, “–list”, action=”store_true”, help=”Print supported materials”)

material_parser.set_defaults(func=self.command_material)

submitted by /u/Trickd122
[link] [comments]

​r/learnpython Im trting to run a script from github issue is it keeps giving the error too few arguments see below # EEPROM encode options eeprom_encode = subparsers.add_parser(“eeprom_encode”, help=”EEPROM – encode from a protobuf”) eeprom_encode.add_argument(“-t”, “–machine-type”, action=”store”, choices=machine.get_machine_types(), help=”Machine type (Fox T-class, Prodigy P-class, Quantum, uPrint, uPrint SE)”, required=True) eeprom_encode.add_argument(“-e”, “–eeprom-uid”, action=”store”, dest=”eeprom_uid”, required=True, help=”Format: [a-f0-9]{14}23, example: 11010a01ba325d23″) eeprom_encode.add_argument(“-D”, “–diag-format”, action=”store_true”, dest=”diag_format”, help=”Produce output in the ASCII format used over the printer diagnostic port”) eeprom_encode.add_argument(“-a”, “–use-ascii”, action=”store_true”, dest=”use_ascii”, help=”Use ASCII format for output file”) eeprom_encode.add_argument(‘input_file’, nargs=’?’, type=argparse.FileType(‘r’), default=sys.stdin) eeprom_encode.add_argument(‘output_file’, nargs=’?’, type=argparse.FileType(‘w’), default=sys.stdout) eeprom_encode.set_defaults(func=self.command_eeprom_encode) # EEPROM decode options eeprom_decode = subparsers.add_parser(“eeprom_decode”, help=”EEPROM – decode from a binary dump”) eeprom_decode.add_argument(“-t”, “–machine-type”, action=”store”, choices=machine.get_machine_types(), help=”Machine type (Fox T-class, Prodigy P-class, Quantum, uPrint, uPrint SE)”, required=True) eeprom_decode.add_argument(“-e”, “–eeprom-uid”, action=”store”, dest=”eeprom_uid”, required=True, help=”Format: [a-f0-9]{14}23, example: 11010a01ba325d23″) eeprom_decode.add_argument(“-D”, “–diag-format”, action=”store_true”, dest=”diag_format”, help=”Read input in the ASCII format used over the printer diagnostic port”) eeprom_decode.add_argument(‘input_file’, nargs=’?’, type=argparse.FileType(‘r’), default=sys.stdin) eeprom_decode.add_argument(‘output_file’, nargs=’?’, type=argparse.FileType(‘w’), default=sys.stdout) eeprom_decode.set_defaults(func=self.command_eeprom_decode) # EEPROM create options eeprom_create = subparsers.add_parser(“eeprom_create”, help=”EEPROM – create a cartridge”) eeprom_create.add_argument(“-m”, “–material-name”, action=”store”, type=str, dest=”material_name”, help=”Run “stratatools-cli.py material –list” for a list of known material”) eeprom_create.add_argument(“-l”, “–manufacturing-lot”, action=”store”, type=str, dest=”manufacturing_lot”, help=”Format [0-9]{4}, examples: 1234 – 0000 – 9999″) eeprom_create.add_argument(“-d”, “–manufacturing-date”, action=”store”, type=self.parse_date, dest=”manufacturing_date”, help=”Format “yyyy-mm-dd hh:mm:ss”, examples: “2014-01-01 13:14:15″”) eeprom_create.add_argument(“-u”, “–use-date”, action=”store”, type=self.parse_date, dest=”use_date”, help=”Format “yyyy-mm-dd hh:mm:ss”, examples: “2014-01-01 13:14:15″”) eeprom_create.add_argument(“-n”, “–initial-material”, action=”store”, type=float, dest=”initial_material_quantity”, help=”Unit: cubic inches, format [0-9]{1,}.[0-9]{1,}, examples: 91.5 – 100.0 – 0.123456789″) eeprom_create.add_argument(“-c”, “–current-material”, action=”store”, type=float, dest=”current_material_quantity”, help=”Unit: cubic inches, format [0-9]{1,}.[0-9]{1,} examples: 91.5 – 100.0 – 0.123456789″) eeprom_create.add_argument(“-k”, “–key-fragment”, action=”store”, dest=”key_fragment”, help=”Format [a-f0-9]{16}, examples: abcdef0123456789″) eeprom_create.add_argument(“-s”, “–serial-number”, action=”store”, type=float, dest=”serial_number”, help=”Format: [0-9]{1,}.0, example: 1.0 – 123456789.0 – 413203.0″) eeprom_create.add_argument(“-v”, “–version”, action=”store”, type=int, dest=”version”, help=”Format: [0-9]{1}, examples: 0 – 1″) eeprom_create.add_argument(“-g”, “–signature”, action=”store”, type=str, default=”STRATASYS”, dest=”signature”, help=”Format: [a-z]{0,9}, examples: STRATASYS – MYOWNSIG – EMPTY”) eeprom_create.add_argument(‘input_file’, nargs=’?’, type=argparse.FileType(‘r’), default=sys.stdin) eeprom_create.add_argument(‘output_file’, nargs=’?’, type=argparse.FileType(‘w’), default=sys.stdout) eeprom_create.set_defaults(func=self.command_eeprom_create) # SetupCode create options setupcode_create = subparsers.add_parser(“setupcode_create”, help=”SetupCode – create a setup code from arguments”) setupcode_create.add_argument(“-n”, “–serial-number”, action=”store”, dest=”serial_number”) setupcode_create.add_argument(“-s”, “–system-type”, action=”store”, dest=”system_type”, choices=SystemType.all()) setupcode_create.add_argument(“-t”, “–type”, action=”store”, dest=”code_type”, choices=CodeType.all()) setupcode_create.add_argument(“-l”, “–envelope-size”, action=”store”, dest=”envelope_size”, choices=EnvelopeSize.all()) setupcode_create.add_argument(“-b”, “–build-speed”, action=”store”, dest=”build_speed”, choices=BuildSpeed.all()) setupcode_create.add_argument(“-m”, “–material”, action=”store”, dest=”material”, nargs=”+”, type=str, choices=CodeMaterial.all()) setupcode_create.add_argument(“-v”, “–version”, action=”store”, dest=”version”) setupcode_create.add_argument(“-k”, “–key”, action=”store”, dest=”key”, type=int, default=0) setupcode_create.set_defaults(func=self.command_setupcode_create) # SetupCode decode options setupcode_decode = subparsers.add_parser(“setupcode_decode”, help=”SetupCode – print information about a setup code”) setupcode_decode.add_argument(“setup_code”, action=”store”) setupcode_decode.set_defaults(func=self.command_setupcode_decode) # # Material options # material_parser = subparsers.add_parser(“material”, help=”Material supported by stratasys”) material_parser.add_argument(“-l”, “–list”, action=”store_true”, help=”Print supported materials”) material_parser.set_defaults(func=self.command_material) submitted by /u/Trickd122 [link] [comments] 

Im trting to run a script from github issue is it keeps giving the error too few arguments see below

# EEPROM encode options

eeprom_encode = subparsers.add_parser(“eeprom_encode”, help=”EEPROM – encode from a protobuf”)

eeprom_encode.add_argument(“-t”, “–machine-type”, action=”store”, choices=machine.get_machine_types(), help=”Machine type (Fox T-class, Prodigy P-class, Quantum, uPrint, uPrint SE)”, required=True)

eeprom_encode.add_argument(“-e”, “–eeprom-uid”, action=”store”, dest=”eeprom_uid”, required=True, help=”Format: [a-f0-9]{14}23, example: 11010a01ba325d23″)

eeprom_encode.add_argument(“-D”, “–diag-format”, action=”store_true”, dest=”diag_format”, help=”Produce output in the ASCII format used over the printer diagnostic port”)

eeprom_encode.add_argument(“-a”, “–use-ascii”, action=”store_true”, dest=”use_ascii”, help=”Use ASCII format for output file”)

eeprom_encode.add_argument(‘input_file’, nargs=’?’, type=argparse.FileType(‘r’), default=sys.stdin)

eeprom_encode.add_argument(‘output_file’, nargs=’?’, type=argparse.FileType(‘w’), default=sys.stdout)

eeprom_encode.set_defaults(func=self.command_eeprom_encode)

# EEPROM decode options

eeprom_decode = subparsers.add_parser(“eeprom_decode”, help=”EEPROM – decode from a binary dump”)

eeprom_decode.add_argument(“-t”, “–machine-type”, action=”store”, choices=machine.get_machine_types(), help=”Machine type (Fox T-class, Prodigy P-class, Quantum, uPrint, uPrint SE)”, required=True)

eeprom_decode.add_argument(“-e”, “–eeprom-uid”, action=”store”, dest=”eeprom_uid”, required=True, help=”Format: [a-f0-9]{14}23, example: 11010a01ba325d23″)

eeprom_decode.add_argument(“-D”, “–diag-format”, action=”store_true”, dest=”diag_format”, help=”Read input in the ASCII format used over the printer diagnostic port”)

eeprom_decode.add_argument(‘input_file’, nargs=’?’, type=argparse.FileType(‘r’), default=sys.stdin)

eeprom_decode.add_argument(‘output_file’, nargs=’?’, type=argparse.FileType(‘w’), default=sys.stdout)

eeprom_decode.set_defaults(func=self.command_eeprom_decode)

# EEPROM create options

eeprom_create = subparsers.add_parser(“eeprom_create”, help=”EEPROM – create a cartridge”)

eeprom_create.add_argument(“-m”, “–material-name”, action=”store”, type=str, dest=”material_name”, help=”Run “stratatools-cli.py material –list” for a list of known material”)

eeprom_create.add_argument(“-l”, “–manufacturing-lot”, action=”store”, type=str, dest=”manufacturing_lot”, help=”Format [0-9]{4}, examples: 1234 – 0000 – 9999″)

eeprom_create.add_argument(“-d”, “–manufacturing-date”, action=”store”, type=self.parse_date, dest=”manufacturing_date”, help=”Format “yyyy-mm-dd hh:mm:ss”, examples: “2014-01-01 13:14:15″”)

eeprom_create.add_argument(“-u”, “–use-date”, action=”store”, type=self.parse_date, dest=”use_date”, help=”Format “yyyy-mm-dd hh:mm:ss”, examples: “2014-01-01 13:14:15″”)

eeprom_create.add_argument(“-n”, “–initial-material”, action=”store”, type=float, dest=”initial_material_quantity”, help=”Unit: cubic inches, format [0-9]{1,}.[0-9]{1,}, examples: 91.5 – 100.0 – 0.123456789″)

eeprom_create.add_argument(“-c”, “–current-material”, action=”store”, type=float, dest=”current_material_quantity”, help=”Unit: cubic inches, format [0-9]{1,}.[0-9]{1,} examples: 91.5 – 100.0 – 0.123456789″)

eeprom_create.add_argument(“-k”, “–key-fragment”, action=”store”, dest=”key_fragment”, help=”Format [a-f0-9]{16}, examples: abcdef0123456789″)

eeprom_create.add_argument(“-s”, “–serial-number”, action=”store”, type=float, dest=”serial_number”, help=”Format: [0-9]{1,}.0, example: 1.0 – 123456789.0 – 413203.0″)

eeprom_create.add_argument(“-v”, “–version”, action=”store”, type=int, dest=”version”, help=”Format: [0-9]{1}, examples: 0 – 1″)

eeprom_create.add_argument(“-g”, “–signature”, action=”store”, type=str, default=”STRATASYS”, dest=”signature”, help=”Format: [a-z]{0,9}, examples: STRATASYS – MYOWNSIG – EMPTY”)

eeprom_create.add_argument(‘input_file’, nargs=’?’, type=argparse.FileType(‘r’), default=sys.stdin)

eeprom_create.add_argument(‘output_file’, nargs=’?’, type=argparse.FileType(‘w’), default=sys.stdout)

eeprom_create.set_defaults(func=self.command_eeprom_create)

# SetupCode create options

setupcode_create = subparsers.add_parser(“setupcode_create”, help=”SetupCode – create a setup code from arguments”)

setupcode_create.add_argument(“-n”, “–serial-number”, action=”store”, dest=”serial_number”)

setupcode_create.add_argument(“-s”, “–system-type”, action=”store”, dest=”system_type”, choices=SystemType.all())

setupcode_create.add_argument(“-t”, “–type”, action=”store”, dest=”code_type”, choices=CodeType.all())

setupcode_create.add_argument(“-l”, “–envelope-size”, action=”store”, dest=”envelope_size”, choices=EnvelopeSize.all())

setupcode_create.add_argument(“-b”, “–build-speed”, action=”store”, dest=”build_speed”, choices=BuildSpeed.all())

setupcode_create.add_argument(“-m”, “–material”, action=”store”, dest=”material”, nargs=”+”, type=str, choices=CodeMaterial.all())

setupcode_create.add_argument(“-v”, “–version”, action=”store”, dest=”version”)

setupcode_create.add_argument(“-k”, “–key”, action=”store”, dest=”key”, type=int, default=0)

setupcode_create.set_defaults(func=self.command_setupcode_create)

# SetupCode decode options

setupcode_decode = subparsers.add_parser(“setupcode_decode”, help=”SetupCode – print information about a setup code”)

setupcode_decode.add_argument(“setup_code”, action=”store”)

setupcode_decode.set_defaults(func=self.command_setupcode_decode)

#

# Material options

#

material_parser = subparsers.add_parser(“material”, help=”Material supported by stratasys”)

material_parser.add_argument(“-l”, “–list”, action=”store_true”, help=”Print supported materials”)

material_parser.set_defaults(func=self.command_material)

submitted by /u/Trickd122
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *