【问题标题】:I can't seem to pydoc raw_input in the terminal(Windows)我似乎无法在终端中使用 pydoc raw_input(Windows)
【发布时间】:2019-01-31 14:36:45
【问题描述】:

我是编程新手,我正在使用 Windows 和 Python2.7。

我尝试在终端中运行python -m pydoc raw_input,但它显示:

'more' is not recognized as an internal or external command, operable program or batch file.

我做错了什么?

【问题讨论】:

  • more 是 UNIX/Linux 默认的“寻呼机”命令。您的 python 似乎认为您在安装了上述命令的机器上。不过不知道如何解决。
  • 试试python -c "help(raw_input)"; edit你的问题与结果。
  • 它似乎没有给出相同的回复
  • 说实话,这就是我所期望的。这或多或少是一回事。哦,好吧,必须尝试。
  • 单独尝试more,看看它是否已安装。如果已安装,它应该输出类似more: bad usage 的内容。如果不是,它应该输出与以前相同的错误。

标签: python windows python-2.7 windows-10-desktop pydoc


【解决方案1】:

它应该可以工作:

Microsoft Windows [Version 10.0.17134.523]
(c) 2018 Microsoft Corporation. All rights reserved.

c:\srv> python -m pydoc raw_input
Help on built-in function raw_input in module __builtin__:

raw_input(...)
    raw_input([prompt]) -> string

    Read a string from standard input.  The trailing newline is stripped.
    If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError.
    On Unix, GNU readline is used if enabled.  The prompt string, if given,
    is printed without a trailing newline before reading.

more.com 位于c:\windows\system32\more.com,因此请确保您的路径包含system32 目录..

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-08-11
    • 2019-08-02
    • 2022-06-28
    • 1970-01-01
    • 2017-06-28
    • 2020-07-10
    • 1970-01-01
    相关资源
    最近更新 更多