Python
momoku233
这个作者很懒,什么都没留下…
展开
-
(捉虫)Launching unittests with arguments python -m unittest discover
初学python,在pycharm里试试函数调用,命名了test1(),test2()函数后报错: Testing started at 13:29 … Launching unittests with arguments python -m unittest discover -s E:/pythonWorks/say_hello -p 函数调用.py -t E:\pythonWorks\...原创 2018-03-23 13:39:20 · 6936 阅读 · 0 评论 -
(捉虫)Spellchecker inspection helps locate typos and misspelling
日常学Python,发现刚定义的变量“xiaoming”下面有一条小灰波浪线~ 尝试Ctrl+Alt+L大法后,没有起效,后用Crl+F1查看提示。Spellchecker inspection helps locate typos and misspelling in your code, comments and literals, and fix them in one click....原创 2018-03-25 19:59:24 · 7306 阅读 · 0 评论 -
Python学习之缺省参数、多值参数
缺省参数def print_info(name, gender = True)缺省参数即是调用该函数时,缺省参数的值若未被传入,则传入默认预设的值。 注意,必须将所有带有默认值的参数置于参数列表的末尾。 当带有多个缺省参数的函数被调用时,可单独指定某个缺省参数的值。如:def print_info(name, age = 18,gender = True )print_inf...原创 2018-04-15 00:19:56 · 7725 阅读 · 0 评论 -
列表元素的几种删除方法
列表元素可以用del语句、pop()方法、remove()方法进行删除。 1.del 语句del LIst[0]del可以删除任意已知位置的列表元素。2.pop() List.pop()一般用来弹出列表最后一个元素(可以接收这个变量),也可在括号里指定索引,来删除指定位置的列表元素。3.remove() List.remove('123')remove()不需...原创 2018-04-03 20:53:53 · 18231 阅读 · 0 评论 -
PyCharm的一个小插件——snake
无聊的时候在PyCharm上想找一个游戏相关的插件,输入game之后弹出了神奇的snake…… 官方的解释是这样的: A snake game inside your code structure in IntelliJ. Make your code more Python-like by helping the snake eat all the curly braces and s...原创 2018-04-06 22:18:51 · 735 阅读 · 0 评论