Issue
I'm using the argparse
library and have a few boolean arguments created like this:
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Generate a batch of Line Protocol points of a specified shape")
parser.add_argument('--loop', action='store_true', help="If True, script runs in infinit loop; used with Telegraf `execd` input plugin")
args = parser.parse_args()
print(args)
This has worked for weeks with no issue and now all of a sudden I'm getting the error:
ipython3: error: argument --loop: expected one argument
Solution
Is this the full error message:
0814:~/mypy$ ipython3 --loop
usage: ipython3 [-h] [--debug] [--quiet] [--init] [--autoindent] [--no-autoindent] [--automagic]
[--no-automagic] [--pdb] [--no-pdb] [--pprint] [--no-pprint] [--color-info]
[--no-color-info] [--ignore-cwd] [--no-ignore-cwd] [--nosep] [--autoedit-syntax]
[--no-autoedit-syntax] [--simple-prompt] [--no-simple-prompt] [--banner] [--no-banner]
[--confirm-exit] [--no-confirm-exit] [--term-title] [--no-term-title] [--classic]
[--quick] [-i] [--profile-dir ProfileDir.location]
[--profile TerminalIPythonApp.profile] [--ipython-dir TerminalIPythonApp.ipython_dir]
[--log-level TerminalIPythonApp.log_level]
[--config TerminalIPythonApp.extra_config_file]
[--autocall TerminalInteractiveShell.autocall]
[--colors TerminalInteractiveShell.colors] [--logfile TerminalInteractiveShell.logfile]
[--logappend TerminalInteractiveShell.logappend] [-c TerminalIPythonApp.code_to_run]
[-m TerminalIPythonApp.module_to_run] [--ext TerminalIPythonApp.extra_extensions]
[--gui TerminalIPythonApp.gui] [--pylab [TerminalIPythonApp.pylab]]
[--matplotlib [TerminalIPythonApp.matplotlib]]
[--cache-size TerminalInteractiveShell.cache_size]
[extra_args [extra_args ...]]
ipython3: error: argument --loop: expected one argument
1240:~/mypy$
Answered By - hpaulj
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.