input/print

Python文件的执行:

1.在终端执行 Python a.py
2.文件内部前面加上能被Linux识别的解释器路径:

#!/usr/bin/env python

才能在Linux终端执行 ./a.py

Python2中,前文需要加能识别中文的编码:

#-*- coding:utf8 -*-

input/print用法:

n1 = input('请输入用户名:')
n2 = input('请输入密码:')
print(n1)
print(n2)

文件抬头在pycharm中设置模板:
File>settings>Editor>File and Code Templates>Python Script

猜你喜欢

转载自blog.csdn.net/weixin_43760098/article/details/84331814