我理解Python是如何工作的,我经常使用来访问函数docstring。但是,我不知道如何使用render_doc来访问帮助主题,例如help("UNARY")。我甚至不知道这样的docstring会在哪里存在。是否有一种方法可以( a)使用pydoc访问帮助主题,或者b)另一种方法来捕获变量中的帮助文本?
help("UNARY") # prints help to console
import pydoc
pydoc.help("UNARY") # print
我希望拥有pdb的交互性,但也需要使用python的帮助函数来内省我不熟悉的对象/方法。
如何使用pdb中python的帮助()?
我尝试的每一件事:
(Pdb) help(help)
*** No help on (help)
(Pdb) help(list())
*** No help on (list())
如果我有一个只有一个冒号的hotkey:,如何用a:: (keybind)触发它?
help:
Gui, Add, Text,, Help:
Gui, Add, Text,, Welcome to the Help screen
...
Return
a::
; Trigger Help here
Return
我发出了一个help命令,当我执行该命令一次时,它就开始工作了,但是在那之后它就停止工作了,这意味着我必须重新运行整个代码。(顺便说一下,这是一个齿轮)如果我不止一次地执行命令,所得到的错误是Ignoring exception in command None: discord.ext.commands.errors.CommandNotFound: Command "help" is not found
import discord
from discord.ext import commands
class help(commands.Cog):
def __ini
在中,如果在没有指定命令的情况下运行CLI,我会得到如下内容:
Options:
-h, --help display help for command
Commands:
foo [options] Foo
bar [options] Bar
help [command] display help for command
但如果我以以下方式运行CLI:
app foo
我想返回唯一命令的所有可用选项。
代码
const foo = () => {
program
.command('foo')
.descripti
当我执行我的程序时,我使用jline的ConsoleReader或BufferedReader阅读,输入的文本是输入的,但不显示。例如,我输入asd,我的控制台不显示asd,但当我按enter时,它告诉我Could not find command 'asd'. Type 'help' for help,所以我输入的字符串将被读取,但不会显示。
Windows命令提示符,启动脚本:
@echo off
java -jar PixelCloud.jar
pause
我试着把我的代码放在一个线程中,使用扫描仪,使用BufferedReader,使用ConsoleRe
我试着做一个帮助命令,但是我不知道如何为一个命令组创建帮助命令,这是主命令与组分开,我尝试做help modmail channel modmail是组,通道是子命令,它只是说命令不存在----这是函数:
请注意,我不是在问如何使用,而是问如何使用我的函数在commands.group()上为子命令创建帮助
async def cmdhelp(self, ctx, command):
params = []
for key, value in command.params.items():
if key not in ("
我使用的是栈lts 5.1附带的opt解析式应用程序,我有一个带有子命令的解析器,我已经为它们的选项描述了一个帮助文本,但是它们没有显示。
这是使用--help运行可执行文件时的输出:
[david@devcentos65 manipro]$ /home/david/.local/bin/manipro --help
manipro - text1
Usage: manipro COMMAND [-v|--verbose] text2
Available options:
-h,--help Show this help text
-v,-
我已经在我的Ubuntu20.04LTS上使用正式的安装了v。
安装成功,因为我可以检查版本:
$ v version
V 0.2.4 310969a
当我试图使用help查看受支持的args时,它会导致一个错误。
$ v help
`v help`: unknown help topic provided. Use `v help` for usage information.
Known help topics:
我尝试了v help, v --help, v -help, v --h, v -h,但是都导致了一个错误。
谢谢。
因此,我在几个教程中创建了一个不和谐的机器人,并且我做了一个自定义的帮助命令,所以我不希望帮助命令显示一些命令,例如加载或卸载齿轮,命令,很少所有者或管理命令。但我不知道怎么做,我检查了几个类似的帖子,但在创建的齿轮与所有者命令,但我的命令是分散在几个齿轮。我对discord.py有点陌生,所以请指点我。谢谢!!预先
这是我的自定义帮助命令代码:-
import random
from typing import Optional
from discord import Embed
from discord.utils import get
from discord.ext.menus imp
我的命令可以工作,但它也显示了这个奇怪的错误消息。当我执行p!help时,我会得到响应和错误消息:
No Category:
clean
help Shows this message
sudo
Type p!help command for more info on a command.
You can also type p!help category for more info on a category.
我在Ruby可执行文件中创建了一个Thor类,它在使用./foo help bar时正确地显示了帮助。
为了让它更直观(对于我的用户来说),我还想支持./foo bar --help和./foo bar -h。当我这么做的时候,我得到:
ERROR: "foo bar" was called with arguments ["--help"]
Usage: "foo bar"
我可以手动执行method_option :help, ...并在bar方法中处理它,但我希望有一种更简单的方法(将该命令重定向到./foo help bar)。
有谁知道
我对vim脚本不太了解,只是对我的vimrc进行了修改。因此,我正在寻求别人的帮助,以了解在这里可以做什么。
我使用vim帮助页面'tips.txt‘中的HelpCurWin命令,标记为' help -curwin’。该命令旨在在当前窗口中打开给定的帮助页,而不是打开新的拆分。这部分工作很好。以下是代码:
" Command to open help page in current window.
command -bar -nargs=? -complete=help HelpCurwin
\ execute s:HelpCurwin(<q-args
像interactive shell这样的python背后的设计模式是什么?我想为我的服务器做这件事,但我最终得到了很多if - then- else模式。
例如,当我启动python interpreter时,得到的结果如下所示
Python 2.6.7 (r267:88850, Feb 2 2012, 23:50:20)
[GCC 4.5.3] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>&g
当你跑步的时候。/没有选择的裤子,你会得到帮助:
$ ./pants help
Pants 0.0.32 https://pypi.python.org/pypi/pantsbuild.pants/0.0.32
Usage:
./pants [option ...] [goal ...] [target...] Attempt the specified goals.
./pants help Get help.
./pants help [goal] Get he
在scala中,可以通过:help显示可用的命令
scala> :help
All commands can be abbreviated, e.g., :he instead of :help.
...
:help [command] print this summary or command-specific help
...
...
:reset [options] reset the repl to its initial state, forgetting all session entries
...
例如,在哪里可以找到[options]
这是我的脚本,我想通过用户接收参数--路径和-模式,例如:
./myscript.sh -path=/hello-mode=a
脚本
#!/usr/bin/env bash
set -e
HELP=false
MODE=false
PATH=false
for arg in "$@"
do
case "$arg" in
-h|--help)
HELP=true
;;
--mode*)
MODE=`echo $arg | sed -e
我正在启动一个CLI管道类型的应用程序项目,它最终将拥有相当多的命令集合(通过插件可以进一步扩展)。因此,我想在--help文本中对它们进行分类:
现在的情况如下:
Usage: my_pipe [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...
Options:
--help Show this message and exit.
Commands:
another_filter help about that filter
another_generator help about that ge
是否可以在由VIM打开的文本文件中执行VIM命令?例如,我们可以有以下文本,我们想要执行:help w而不键入它。
Read the text in the help window to find out how the help works.
Type CTRL-W CTRL-W to jump from one window to another.
Type :q <ENTER> to close the help window.
You can find help on just about any subject, by giving a
如何自定义JLine 3中的帮助命令?my 中的帮助显示为:
manager> help
System:
exit exit from app/script
help command help
Builtins:
ShellCommandRegistry:
create Create some stuff with minimal fuss...
delete Deletes some stuff with minimal fuss...
list List some stuff with minimal fuss...
我正在写我的第一个symfony控制台应用程序,我想问一个关于控制台输出的问题。
当我在控制台中运行一个新的命令行界面应用程序时:./testapp,然后我得到以下输出:
Usage:
command [options] [arguments]
Options:
--help (-h) Display this help message
--quiet (-q) Do not output any message
--verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for nor
我试图寻找我的问题无法得到答案,也许是因为我不知道如何正确地问它,所以我提前道歉。
我正在尝试执行bash脚本中的命令链,例如:
run mysql > type help > exit
root@ubuntu:# mysql
mysql> help
mysql> exit
root@ubuntu:#
如何在bash脚本中实现这一点?
我尝试过这些操作数&&,&;所有这些,例如:
#!/bin/bash
mysql || help || exit
没起作用。它互相执行命令。