使用`input`函数
```python
name = input("请输入您的姓名:")
print(f"您好,{name}!")
在代码注释中添加
```python
Developed by John Doe
def func_name():
Code goes here
在模块的docstring中添加
```python
"""
This is the module docstring, developed by John Doe
"""
def func_name():
Code goes here
使用`setproctitle`库自定义进程名 (如果需要在后台运行脚本并查看进程名):
```python
import setproctitle
setproctitle.setproctitle("MyPythonScript")
Your code here
使用`matplotlib`绘制姓名
```python
import matplotlib.pyplot as plt
def draw_name(name):
fig, ax = plt.subplots()
fig.set_size_inches(5, 3)
fig.set_facecolor('white')
ax.text(0.5, 0.5, name, fontsize=100, ha='center', va='center')
ax.set_axis_off()
plt.show()
name = input("请输入您的姓名:")
draw_name(name)
调整名字的大小写
```python
name = "rose"
print(name.lower())
print(name.upper())
print(name.title())
以上方法可以帮助您在Python代码中添加名字。您可以根据需要选择合适的方法