欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

【Python+Pycharm】单词底部有波浪线,提示typo in word时

程序员文章站 2022-07-14 11:42:04
...
在使用IDEA时,代码中单词底部有波浪线,提示typo in word时 
原因:单词拼写检查功能,说明当前拼写有问题, 

解决方式:按照驼峰命名法,重新命名即可 

#########

使用自己的名字当Tag。却发现有个非常不用好的提示。波浪,我浪个你妹。

【Python+Pycharm】单词底部有波浪线,提示typo in word时

Typo:In word ‘miyuehu’ less...(Ctrl+F1)

spellchecker inspection helps locate typos and misspelled in your code,comments and literals, and fix them in one click.

我尼玛,不能接受。赶紧度娘,找解决办法。。。

File----Settings


【Python+Pycharm】单词底部有波浪线,提示typo in word时【Python+Pycharm】单词底部有波浪线,提示typo in word时






























把Spelling typo勾选去掉(禁用单词拼写检查)

【Python+Pycharm】单词底部有波浪线,提示typo in word时


点击 apply 关掉窗口。在看看,波浪提示果然消失了。哈哈~~~



高兴之余。默默。。。看了下這句话的翻译。。。

spellchecker inspection helps locate typos and misspelled in your code,comments and literals, and fix them in one click.

机器翻译出来就是:

拼写检查器检查可以帮助查找拼写错误拼写错误代码、 注释文本 修复它们一次点击


這一看,這个功能挺好的啊!!!每个东西,都有它存在的价值。。。思考。。。动手。。。


耶,有发现啊!!!选中单词,单击鼠标右键,卧槽。

【Python+Pycharm】单词底部有波浪线,提示typo in word时



Change to...就不用了。

Save ‘miyuehu’ to dictionary...不就是保存到词典的意思嚒。。。果断点了。在看看,波浪消失了。


至此,波浪终于被解决了,或许這个才是解决办法吧。

#############

驼峰命名法:

https://baike.baidu.com/item/%E9%AA%86%E9%A9%BC%E5%91%BD%E5%90%8D%E6%B3%95/7794053?fromtitle=%E9%A9%BC%E5%B3%B0%E5%91%BD%E5%90%8D%E6%B3%95&fromid=7560610&fr=aladdin

#######################

作为一个pyCharm新手,不得不说这款IDE写Python确实挺舒服。 
不过因为代码风格问题,遇到了function name should be lowercase问题,着实烦人,在这里分享一下解决方案。

File –>Settings–>Editor–>Inspections–>Python–>PEP 8 naming convention violation

在右下角有一个Ignored errors列表控件,添加 
N802 
N803 
N806

code    sample message
N801    class names should use CapWords convention
N802    function name should be lowercase
N803    argument name should be lowercase
N804    first argument of a classmethod should be named 'cls'
N805    first argument of a method should be named 'self'
N806    variable in function should be lowercase

N811    constant imported as non constant
N812    lowercase imported as non lowercase
N813    camelcase imported as lowercase
N814    camelcase imported as constant