在Python中,你可以使用`input()`函数从命令行获取用户输入。下面是如何使用`input()`函数的基本示例:
```python
Python 3.6 或更高版本
name = input("Enter your name: ")
print("Hello, " + name + "!")
在Python 2.7中,使用`raw_input()`函数:
```python
Python 2.7
name = raw_input("Enter your name: ")
print "Hello, " + name + "!"
`input()`函数会等待用户输入,并将输入的内容作为字符串返回。如果你需要其他类型的数据(如整数或浮点数),可以使用`int()`或`float()`函数进行类型转换。