V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
ling516
V2EX  ›  Python

pycharm 如何快速打出三双引号快捷键?

  •  
  •   ling516 · 2022-01-26 04:22:53 +08:00 · 3348 次点击
    这是一个创建于 813 天前的主题,其中的信息可能已经有所发展或是发生改变。

    """"""

    4 条回复    2022-02-09 13:27:39 +08:00
    ila
        1
    ila  
       2022-01-26 06:52:14 +08:00 via Android
    live template 。
    或打出三个后回车,IDE 自动补全
    2i2Re2PLMaDnghL
        2
    2i2Re2PLMaDnghL  
       2022-01-26 10:11:24 +08:00   ❤️ 1
    俺寻思 PyCharm 自带,打三个引号自动补成六个
    连续按下引号时:

    |
    "|"
    ""|
    """|"""
    ipwx
        3
    ipwx  
       2022-01-26 10:47:41 +08:00
    PyCharm 自带,打三个 """ 变成六个,换行还自动产生 docstring 的格式。
    bcaso
        4
    bcaso  
       2022-02-09 13:27:39 +08:00
    使用 AHK 脚本。

    !'::
    {
    Send, """"""{Left 3}{Enter}{Enter}{Up}
    return
    }

    效果是在按下 alt+' 键后输出:

    先输出 6 个 " 再点击键盘上的左方向键 3 次,再点击两次 Enter 键,最后点击一次上方向键。

    """
    光标停在中间
    """

    如果怕误触发,可以加利用 Caplock 键的状态做一个判断:

    !`::
    {
    If GetKeyState("ScrollLock","T") ; 在大写键开启的状态下执行
    {
    Send, ````````````{Left 3}{Enter}{Enter}{Up}
    return
    }
    return
    }
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4192 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 05:20 · PVG 13:20 · LAX 22:20 · JFK 01:20
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.