Pycharm添加自定义模板
- 打开Pycharm设置并选中File->Settings->Editor->File and Code Templates
- 在file中选中需要修改的脚本类型,如Python Script
修改Live Templates也是挺不错的,这里的作用主要是敲代码时的快捷提示(File->Settings->Editor->Live Templates)
代码模板
python文件-头注释
#!/usr/bin/python
# -*- coding:utf-8 -*-
# @author : afeng
# @time : ${DATE} ${TIME}
# @function: the script is used to do something.
# @version :
# V1
#
python代码提示 (都是没事的时候整的一些花活(#^.^#)正好配合Live Templates使用)
这俩造型是我辛辛苦苦原创的哦 o(╥﹏╥)o
# main processes here
if __name__ == '__main__':
print("""\033[1;32m
___ ___ _ _ _ _ || _ _ _ _
/ \/ \ / 9_9_9 \ ( ) / n . n \
| m m | | @ @ | (____) | / \ |
| | | | | | | V * V | ii | | | |
| | oo | | | V ^ V \ ii | | | |
|__| |__| \_V_ _ _V/\__\ ii |_ _| |_ _| processes are running now!
\033[0m""")
# test processes here
if __name__ == '__main__':
print("""\033[1:33m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
\ _ _ _ _\ \ _ _ _ _\ / _ _ \ \ _ _ _ _\
\ \ test \ \_ _ _ _ \ \ _ _ _ \ \
\ \ some- \ _ _ _ _\ \ _ _ _ _ \ \ \
\ \ thing \ \_ _ _ _ _ _ _ _\ | \ \
\_ _\ here! \_ _ _ _ _ _\ \ _ _ _ _ / \_ _\ processes are running now!
\033[0m""")
print字体颜色调整
- 蓝色
print(f'\033[1;34m $END$\033[0m')
- 绿色
print(f'\033[1;32m $END$\033[0m')
- 红色
print(f'\033[1;31m $END$\033[0m')
- 黄色
print(f'\033[1;33m $END$\033[0m')
效果展示
- main进程
- test进程
- 花里胡哨的彩色print