相当于readline.get_line_缓冲区在果朗

2024-10-02 00:22:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试在基于golangcli的程序中实现this行为。 行为很简单,我只想在用户输入内容的同时打印一些内容到控制台。在

这是我写的代码。在

// %a code that reads the user input in a different thread% 
fmt.Print("\r[*] this is a message.") // erases the current line then prints the message
fmt.Print("\n\r") // creates new empty line
fmt.Print(">>> " + %CURRENT_STDIN_LINE_BUFFER%) // prints the prompt ">>>" then writes the user input 

唯一缺少的是readline.get_line_缓冲区()golang中的python函数。在


Tags: the代码用户程序内容messageinputline

热门问题