用户如何使用shell与我的python脚本进行通信?

Nic*_*tes 3 python

如何在python中实现以下功能?

#include <iostream>

int main() {
   std::string a; 
   std::cout <<  "What is your name? ";
   std::cin >> a; 
   std::cout << std::endl << "You said: " << a << std::endl;
}
Run Code Online (Sandbox Code Playgroud)

输出:

你叫什么名字?缺口

你说:尼克

Swa*_*C H 7

呼叫

name = raw_input('What is your name?')
Run Code Online (Sandbox Code Playgroud)

print 'You said', name
Run Code Online (Sandbox Code Playgroud)