当前位置: 首页>>代码示例>>Python>>正文


Python MagicCommandParser.add_argument方法代码示例

本文整理汇总了Python中pyquickhelper.ipythonhelper.MagicCommandParser.add_argument方法的典型用法代码示例。如果您正苦于以下问题:Python MagicCommandParser.add_argument方法的具体用法?Python MagicCommandParser.add_argument怎么用?Python MagicCommandParser.add_argument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyquickhelper.ipythonhelper.MagicCommandParser的用法示例。


在下文中一共展示了MagicCommandParser.add_argument方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: textdiff_parser

# 需要导入模块: from pyquickhelper.ipythonhelper import MagicCommandParser [as 别名]
# 或者: from pyquickhelper.ipythonhelper.MagicCommandParser import add_argument [as 别名]
 def textdiff_parser():
     """
     defines the way to parse the magic command ``%textdiff``
     """
     parser = MagicCommandParser(prog="textdiff",
                                 description='show the differences between two files, two text')
     parser.add_argument('f1', type=str, help='first file or text or url')
     parser.add_argument('f2', type=str, help='second file or text or url')
     parser.add_argument(
         '-c',
         '--context',
         default="",
         help='context view, empty to see everything, > 0 to see only a couple of lines around the changes')
     parser.add_argument(
         '-i',
         '--inline',
         action="store_true",
         default=False,
         help='True=one column (inline) or False=two columns')
     parser.add_argument(
         '-e',
         '--encoding',
         default="utf8",
         help='file encoding')
     return parser
开发者ID:GuillaumeSalha,项目名称:pyensae,代码行数:27,代码来源:magic_file.py

示例2: head_parser

# 需要导入模块: from pyquickhelper.ipythonhelper import MagicCommandParser [as 别名]
# 或者: from pyquickhelper.ipythonhelper.MagicCommandParser import add_argument [as 别名]
 def head_parser():
     """
     defines the way to parse the magic command ``%head``
     """
     parser = MagicCommandParser(prog="head",
                                 description='display the first lines of a text file')
     parser.add_argument('f', type=str, help='filename')
     parser.add_argument(
         '-n',
         '--n',
         type=int,
         default=10,
         help='number of lines to display')
     parser.add_argument(
         '-r',
         '--raw',
         default=False,
         action='store_true',
         help='display raw text instead of HTML')
     parser.add_argument(
         '-e',
         '--encoding',
         default="utf8",
         help='file encoding')
     parser.add_argument(
         '-s',
         '--errors',
         default="",
         help='What about errors: "", strict, replace, surrogateescape, '
              'xmlcharrefreplace, backslashreplace, namereplace')
     return parser
开发者ID:sdpython,项目名称:pyensae,代码行数:33,代码来源:magic_file.py

示例3: lsrepo_parser

# 需要导入模块: from pyquickhelper.ipythonhelper import MagicCommandParser [as 别名]
# 或者: from pyquickhelper.ipythonhelper.MagicCommandParser import add_argument [as 别名]
 def lsrepo_parser():
     """
     Defines the way to parse the magic command ``%lsrepo``.
     """
     parser = MagicCommandParser(prog="lsrepo",
                                 description='display the content of a repository (GIT or SVN)')
     parser.add_argument('path', type=str, nargs="?",
                         help='path', default=".")
     return parser
开发者ID:sdpython,项目名称:pyensae,代码行数:11,代码来源:magic_file.py

示例4: hd_job_kill_parser

# 需要导入模块: from pyquickhelper.ipythonhelper import MagicCommandParser [as 别名]
# 或者: from pyquickhelper.ipythonhelper.MagicCommandParser import add_argument [as 别名]
 def hd_job_kill_parser():
     """
     defines the way to parse the magic command ``%hd_job_kill``
     """
     parser = MagicCommandParser(prog="hd_job_kill",
                                 description='kill a job')
     parser.add_argument(
         'jobid',
         type=str,
         help='job id')
     return parser
开发者ID:GuillaumeSalha,项目名称:pyensae,代码行数:13,代码来源:magic_azure.py

示例5: hd_job_status_parser

# 需要导入模块: from pyquickhelper.ipythonhelper import MagicCommandParser [as 别名]
# 或者: from pyquickhelper.ipythonhelper.MagicCommandParser import add_argument [as 别名]
 def hd_job_status_parser():
     """
     defines the way to parse the magic command ``%hd_job_status``
     """
     parser = MagicCommandParser(prog="hd_job_status",
                                 description='get the status of the job')
     parser.add_argument(
         'jobid',
         type=str,
         help='job id')
     return parser
开发者ID:GuillaumeSalha,项目名称:pyensae,代码行数:13,代码来源:magic_azure.py

示例6: blob_rmr_parser

# 需要导入模块: from pyquickhelper.ipythonhelper import MagicCommandParser [as 别名]
# 或者: from pyquickhelper.ipythonhelper.MagicCommandParser import add_argument [as 别名]
 def blob_rmr_parser():
     """
     defines the way to parse the magic command ``%blob_rmr``
     """
     parser = MagicCommandParser(prog="blob_rmr",
                                 description='remove a remote folder')
     parser.add_argument(
         'remotepath',
         type=str,
         help='remote path to remove')
     return parser
开发者ID:GuillaumeSalha,项目名称:pyensae,代码行数:13,代码来源:magic_azure.py

示例7: HIVE_parser

# 需要导入模块: from pyquickhelper.ipythonhelper import MagicCommandParser [as 别名]
# 或者: from pyquickhelper.ipythonhelper.MagicCommandParser import add_argument [as 别名]
 def HIVE_parser():
     """
     defines the way to parse the magic command ``%%HIVE``
     """
     parser = MagicCommandParser(prog="HIVE",
                                 description='The command store the content of the cell as a local file.')
     parser.add_argument(
         'file',
         type=str,
         help='file name')
     return parser
开发者ID:GuillaumeSalha,项目名称:pyensae,代码行数:13,代码来源:magic_remote_ssh.py

示例8: dfs_mkdir_parser

# 需要导入模块: from pyquickhelper.ipythonhelper import MagicCommandParser [as 别名]
# 或者: from pyquickhelper.ipythonhelper.MagicCommandParser import add_argument [as 别名]
 def dfs_mkdir_parser():
     """
     defines the way to parse the magic command ``%dfs_mkdir``
     """
     parser = MagicCommandParser(prog="dfs_mkdir",
                                 description='create a folder')
     parser.add_argument(
         'path',
         type=str,
         help='path to remove')
     return parser
开发者ID:GuillaumeSalha,项目名称:pyensae,代码行数:13,代码来源:magic_remote_ssh.py

示例9: PYTHON_parser

# 需要导入模块: from pyquickhelper.ipythonhelper import MagicCommandParser [as 别名]
# 或者: from pyquickhelper.ipythonhelper.MagicCommandParser import add_argument [as 别名]
 def PYTHON_parser():
     """
     Defines the way to parse the magic command ``%%PYTHON``.
     """
     parser = MagicCommandParser(prog="PYTHON",
                                 description='the command stores the content of the cell as a local file.')
     parser.add_argument(
         'file',
         type=str,
         help='filename')
     return parser
开发者ID:sdpython,项目名称:pyensae,代码行数:13,代码来源:magic_file.py

示例10: dfs_ls_parser

# 需要导入模块: from pyquickhelper.ipythonhelper import MagicCommandParser [as 别名]
# 或者: from pyquickhelper.ipythonhelper.MagicCommandParser import add_argument [as 别名]
 def dfs_ls_parser():
     """
     defines the way to parse the magic command ``%dfs_ls``
     """
     parser = MagicCommandParser(prog="dfs_ls",
                                 description='returns the content of a folder from the cluster as a dataframe')
     parser.add_argument(
         'path',
         type=str,
         help='path to look into')
     return parser
开发者ID:GuillaumeSalha,项目名称:pyensae,代码行数:13,代码来源:magic_remote_ssh.py

示例11: job_syntax_parser

# 需要导入模块: from pyquickhelper.ipythonhelper import MagicCommandParser [as 别名]
# 或者: from pyquickhelper.ipythonhelper.MagicCommandParser import add_argument [as 别名]
 def job_syntax_parser():
     """
     defines the way to parse the magic command ``%job_syntax``
     """
     parser = MagicCommandParser(prog="remote_py",
                                 description='check syntax of a pig job')
     parser.add_argument(
         'file',
         type=str,
         help='file name')
     return parser
开发者ID:GuillaumeSalha,项目名称:pyensae,代码行数:13,代码来源:magic_remote_ssh.py

示例12: blob_lsl_parser

# 需要导入模块: from pyquickhelper.ipythonhelper import MagicCommandParser [as 别名]
# 或者: from pyquickhelper.ipythonhelper.MagicCommandParser import add_argument [as 别名]
 def blob_lsl_parser():
     """
     defines the way to parse the magic command ``%blob_lsl``
     """
     parser = MagicCommandParser(prog="blob_lsl",
                                 description='describes the content of folder in a blob storage + metadata')
     parser.add_argument(
         'path',
         type=str,
         help='path to look into, </path> or <container>/<path>')
     return parser
开发者ID:GuillaumeSalha,项目名称:pyensae,代码行数:13,代码来源:magic_azure.py

示例13: open_remote_shell_parser

# 需要导入模块: from pyquickhelper.ipythonhelper import MagicCommandParser [as 别名]
# 或者: from pyquickhelper.ipythonhelper.MagicCommandParser import add_argument [as 别名]
 def open_remote_shell_parser():
     """
     defines the way to parse the magic command ``%open_remote_shell``
     """
     parser = MagicCommandParser(prog="open_remote_shell",
                                 description='command will execute as if they were in a shell')
     parser.add_argument(
         '-f',
         '--format',
         type=str,
         default='html',
         help='formart of this output, html or plain')
     return parser
开发者ID:GuillaumeSalha,项目名称:pyensae,代码行数:15,代码来源:magic_remote_ssh.py


注:本文中的pyquickhelper.ipythonhelper.MagicCommandParser.add_argument方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。