← 返回命令列表

Linux command

ptpython3 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start Python 3 REPL

ptpython3

Start with vi mode

ptpython3 --vi

Execute file then REPL

ptpython3 -i [script.py]

说明

ptpython3 is the Python 3 variant of ptpython, an enhanced interactive REPL with syntax highlighting, autocompletion, multi-line editing, and vi/emacs key bindings built on the prompt_toolkit library. On modern systems where Python 3 is the default, ptpython and ptpython3 are typically identical. The separate binary exists for systems where both Python 2 and Python 3 are installed side by side.

参数

--vi
Use Vi key bindings instead of the default Emacs bindings.
-i, --interactive
Drop into an interactive REPL after executing _FILE_.
--asyncio
Run an asyncio event loop so top-level _await_ expressions work.
--light-bg
Use a color scheme tuned for terminals with a light background.
--dark-bg
Use a color scheme tuned for terminals with a dark background.
--config-file _PATH_
Load configuration from a non-default file.
--history-file _PATH_
Use the specified file for input history.
-V, --version
Display version information.

FAQ

What is the ptpython3 command used for?

ptpython3 is the Python 3 variant of ptpython, an enhanced interactive REPL with syntax highlighting, autocompletion, multi-line editing, and vi/emacs key bindings built on the prompt_toolkit library. On modern systems where Python 3 is the default, ptpython and ptpython3 are typically identical. The separate binary exists for systems where both Python 2 and Python 3 are installed side by side.

How do I run a basic ptpython3 example?

Run `ptpython3` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --vi do in ptpython3?

Use Vi key bindings instead of the default Emacs bindings.