正规365体育投注

Dark mode beta

You’ve been asking for dark mode for years.
The is finally here.

Change your preferences正规365体育投注 any time.

Questions tagged [argparse]

正规365体育投注 A Python module for implementing command-line interfaces

Filter by
Sorted by
Tagged with
0
votes
0answers
18 views

To write test case for argparser [closed]

My method contains the following: value_list = ['a','b','c'] import argparse parser = argparse.ArgumentParser() for value in value_list: parser.add_argument('--{}'.format(...
0
votes
1answer
16 views

Python: is there an equivalent to logging.getLogger(__name__) for argparse's parsers to pass args between modules?

The logging library allows us to define a global logger that can be accessed from any imported modules, like so: main_script.py: import logging import module.py if __name__ == "__main__": ...
0
votes
0answers
9 views

unrecognized arguments in argparse error while tring to pass a directory path

I was trying to add a command line argument for passing file path to the code. But I am getting this error usage: Speakerdiar.py Speakerdiar.py: error: unrecognized arguments: --path /home/shiva/...
-1
votes
0answers
16 views

New to python. Learning with demo codes. Can anyone Help me out

even if parsign is done as mentioned below in windows PYTHON IDLE 3.7 ap = argparse.ArgumentParser() ap.add_argument("-p", "--prototxt", required=True, help="path to Caffe 'deploy' prototxt file")...
0
votes
0answers
17 views

Cannot solve error in my program. Can anyone help for error mentioned below? [closed]

= RESTART: C:\Users\mgram\AppData\Local\Programs\Python\Python37\real-time-object-detection\123.py usage: 123.py [-h] -p PROTOTXT -m MODEL [-c CONFIDENCE] 123.py: error: the following arguments are ...
-1
votes
4answers
45 views

Argparse: str object has no attribute

Not sure what is going on here. Passing 2 arguments to an argparser, getting an error. Am I passing my arguments improperly? Here is the code I am running. parser = argparse.ArgumentParser() parser....
0
votes
0answers
16 views

How to parse raw string with ArgParser in python? [duplicate]

I have a program where I have the argument is a string and need to parse with argParser, argParse takes the array of argument to work, so suppose I have argument string as --foo val1 --bar val2 and ...
0
votes
1answer
36 views

Using argparse in python to parse an entire JSON

I am trying to parse an entire Json in a simple argument using ARGPARSE library, the thing is that it stops suddenly when it hits different elements inside the son, like "-" and " ". Here is the test ...
1
vote
1answer
24 views

Argparse not parsing boolean arguments?

I am trying to make a build script like this: import glob import os import subprocess import re import argparse import shutil def create_parser(): parser = argparse.ArgumentParser(description='...
0
votes
1answer
18 views

Using argparser in combination with questions to the user

so I am trying to make my code usable though argparse but I am expecting that most users are not so familiar with running something in a console. Is their a way that I would request the input through ...
-1
votes
1answer
31 views

argparse: Ignore positional arguments if a flag is set?

I want to provide the command with 3 arguments: <version>, <input file> and <output file> under normal usage. Except there's a specific flag --init, which will basically run the ...
1
vote
1answer
48 views

How to take two positional arguments when optinal isn't set in argparse

I want to write a argparse command that needs two postional arguments when I don't set a optional argument. In my case it's like I want to call it with two necessary parameters but when I say python3 ...
-1
votes
1answer
32 views

open file.txt and store into variable using argparse

how do i have to open file.txt and store the value into 2 variables name inputfileone and inputfiletwo but the error keep confusing me....even file location is true...when i run the command python ...
0
votes
0answers
17 views

Nested subparsers of second order in argparser

I am trying to do subparser of second order using Argparse but it does not see an arguments of this second order subparser. My code is something like that: import argparse parser = argparse....
0
votes
1answer
12 views

Python argparse @fromfile argument not recognised

I'm trying to set an argument in a "fromfile" text file, but it's not recognised, however if I copy/paste the SAME arguments into the command line, it works! What's going on? Here's a minimal example:...

15 30 50 per page
1
2 3 4 5
172