Share PyCharm five weekly tips (six)

Hello everyone, I'm here to give you updates PyCharm of tips today.

Starting from March 24 this year until today, nearly four months. Including manual carefully updated a total of six articles, each 5 little skill, a total of 30.

These 30 tips, all in my own use PyCharm considered to be more useful, extracted for everyone to share, although there are only a small number of configurations, but configured, the course was able to save a lot of time .

This is the sixth article in this series, but also the last article. I do not know you're reading this article, after reading this series, whether there will be little help? If so, then I take the time to sort out these really worth it.

As usual, if you have not seen before five, you can click here to view it.

1, sharing five PyCharm weekly tips (a)

2, share a weekly five PyCharm use skills (b)

3, share tips weekly five PyCharm (c)

4, share tips PyCharm week five (four)

5, to share five PyCharm weekly tips (five)

26 file differences, easier than for

Program development in essential artifact, beyond compare certainly be ranked number one.

Although easy to use, but this is something that is free.

If it is simpler than for a single file, in fact, PyCharm own use.

Click the source file, and then click View-> Compare With …-> select the destination file

Comparative example, you can see the picture below, UI do or good looking.

The editing unit 27 as the block

Debut give you small problems, like the following code, if the case does not affect the code, quickly delete the comment after the code behind it?

There are two ways I can think of, if you like such as regular notes, you can use 正则匹配+ 替换to achieve.

对于这个场景我想到了可以用 vim来轻松的解决,vim 支持块编辑,可以以列为单位选择区域然后进行操作,这在vim中是很常用的一个取消注释的操作。

同样回到 PyCharm 中来,你会发现它也支持块编辑。

当你按住 alt(windows)或者option(mac),然后使用鼠标进行选择,你会发现这样一件神奇的事情。

28 智能补全,忽略大小写

智能搜索补全,是IDE的最吸引人的功能之一。

当你的对象是以大写字母开头时,而你使用小写字母编写代码时,是不能查找到该函数的,你必须得先切换成大写再输入一遍。

如何避免这种尴尬的情况?

只要在配置中关闭大小写匹配即可。

效果如下:

29 保护眼睛,从PyCharm开始

记得刚毕业时,进入的第一家公司,有一个小姐姐,她把自己的电脑中对保护眼睛有用的配置都研究了一番。

其中就有程序的护眼色,什么word,excel,文件管理器,浏览器,能更改背景色的,全部设置个遍。

不能不说,合理的背景色,确实对保护眼睛有一定的作用,但个人觉得最重要的还是合理适时的休息。

这里就教大家如何设置 PyCharm 的背景色为护眼色,方法如下:

设置护眼色,会降低 PyCharm 的顔值,这需要你从中取一个取舍。

关于提高 PyCharm 顔值的,你可以参考我之前写的这篇文章:

手把手教你打造一个顔值超高的IDE

30 调试远程服务器的代码

一般情况下,我们开发调试都是在个人PC上完成,遇到问题,开一下 Pycharm 的调试器,很快就能找到问题所在。

可有些时候,项目代码的运行会对运行环境有依赖,必须在部署了相关依赖组件的服务器上才可以运行,这就直接导致了我们不能在本地进行调试。

对于这种特殊的场景,就我所知,有如下两种解决方案:

  • pdb
  • 远程调试

关于 pdb,之前也写过专门的文章介绍使用方法,你可以点此查看:无图形界面的代码调试方法 - pdb

而远程调试呢,是让我们可以在我们在 PC 上用 Pycharm 的图形化界面来进行调试远方服务器上代码,它和本地调试没有太大的区别,原来怎么调试的现在还是怎么调试。

区别就在于,本地调试不需要事前配置,只要你的代码准备好了,随时可以开始 Debug ,而远程调试需要不少前置步骤。

而这些配置步骤还挺多的,我专门写了一篇文章介绍设置过程,你可以点此查看:图文教程|不能不会的远程调试技巧


至此,本系列 30 个 PyCharm 小技巧全部更新完毕了。

希望对你掌握和配置 PyCharm 会有帮助,想继续看文章的朋友,也可以关注我的公众号「Python编程时光」,所有的文章都会在那里首发,公众号里的文章我都经过精心的排版,阅读体验好。欢迎大家来订阅。


关注公众号,获取最新干货!-

Guess you like

Origin www.cnblogs.com/wongbingming/p/11229265.html