欢迎各位兄弟 发布技术文章
这里的技术是共享的
http://blog.csdn.net/pipisorry/article/details/39909057
pycharm Learning tips:
/pythoncharm/help/tip of the day:
A special variant of the Code Completion feature invoked by pressing Ctrl+Space twice allows you to complete the name of any class no matter if it was imported in the current file or not. If the class is not imported yet, the import statement is generated automatically.
You can quickly find all places where a particular class, method or variable is used in the whole project by positioning the caret at the symbol's name or at its usage in code and pressing Alt+Shift+F7 (Find Usages in the popup menu).
To navigate to the declaration of a class, method or variable used somewhere in the code, position the caret at the usage and press F12. You can also click the mouse on usages with the Ctrl key pressed to jump to declarations.
You can easily rename your local variables with automatic correction of all places where they are used.
To try it, place the caret at the variable you want to rename, and press Shift+F6 (Refactor | Rename). Type the new name in the popup window that appears, or select one of the suggested names, and press Enter.
...
在PyCharm安装目录 /opt/pycharm-3.4.1/help目录下可以找到ReferenceCard.pdf快捷键英文版说明
or 打开pycharm > help > default keymap ref
PyCharm Default Keymap ...
PyCharm3.0默认快捷键(翻译的)
1、编辑(Editing)Ctrl + Tab在窗口间进行切换
11.OTH
ctrl单击引入模块 进入模块查看
一些常用设置:
file -> Setting ->Editor
1. 设置Python自动引入包,要先在 >general > autoimport -> python :show popup
快捷键:Alt + Enter: 自动添加包2. “代码自动完成”时间延时设置
> Code Completion -> Auto code completion in (ms):0 -> Autopopup in (ms):500
3. Pycharm中默认是不能用Ctrl+滚轮改变字体大小的,可以在〉Mouse中设置
4. 显示“行号”与“空白字符”
> Appearance -> 勾选“Show line numbers”、“Show whitespaces”、“Show method separators”
5. 设置编辑器“颜色与字体”主题
> Colors & Fonts -> Scheme name -> 选择"monokai"“Darcula”
说明:先选择“monokai”,再“Save As”为"monokai-pipi",因为默认的主题是“只读的”,一些字体大小颜色什么的都不能修改,拷贝一份后方可修改!
修改字体大小
> Colors & Fonts -> Font -> Size -> 设置为“14”
6. 设置缩进符为制表符“Tab”
File -> Default Settings -> Code Style
-> General -> 勾选“Use tab character”
-> Python -> 勾选“Use tab character”
-> 其他的语言代码同理设置
7. 去掉默认折叠> Code Folding -> Collapse by default -> 全部去掉勾选
8. pycharm默认是自动保存的,习惯自己按ctrl + s 的可以进行如下设置:> Editor Tabs -> Mark modified tabs with asterisk 打上勾
9.>file and code template>python scripts
#!/usr/bin/env python
# coding=gbk
"""
__title__ = 'Clustering – Finding Related Posts'
__author__ = '$USER'
__mtime__ = '$DATE'
# code is far away from bugs with the god animal protecting
┏┓ ┏┓
┏┛┻━━━┛┻┓
┃ ━ ┃
┃ ┳┛ ┗┳ ┃
┃ ┻ ┃
┗━┓ ┏━┛
┃ ┗━━━┓
┃ 神兽保佑 ┣┓
┃ 永无BUG! ┏┛
┗┓┓┏━┳┓┏┛
┃┫┫ ┃┫┫
┗┻┛ ┗┻┛
"""
10
File Encodings> IDE Encoding: UTF-8;Project Encoding: UTF-8;
File -> Settings -> appearance
1. 修改IDE快捷键方案
> Keymap
1) execute selection in console : add keymap > ctrl + enter
系统自带了好几种快捷键方案,下拉框中有如“defaul”,“Visual Studio”,在查找Bug时非常有用,“NetBeans 6.5”,“Default for GNOME”等等可选项,
因为“Eclipse”方案比较大众,个人用的也比较多,最终选择了“Eclipse”。
还是有几个常用的快捷键跟Eclipse不一样,为了能修改,还得先对Eclipse方案拷贝一份:
(1).代码提示功能,默认是【Ctrl+空格】,现改为跟Eclipse一样,即【Alt+/】
Main menu -> code -> Completion -> Basic -> 设置为“Alt+/”
Main menu -> code -> Completion -> SmartType -> 设置为“Alt+Shift+/”
不过“Alt+/”默认又被
Main menu -> code -> Completion -> Basic -> Cyclic Expand Word 占用,先把它删除再说吧(单击右键删除)!
(2).关闭当前文档,默认是【Ctrl+F4】,现改为跟Eclipse一样,即【Ctrl+W】
Main menu -> Window -> Active Tool Window -> Close Active Tab -> 设置为 “Ctrl+F4”;
Main menu -> Window -> Editor -> Close -> 设置为 “Ctrl+W”;2.设置IDE皮肤主题
> Theme -> 选择“Alloy.IDEA Theme”
或者在setting中搜索theme可以改变主题,所有配色统一改变
File > settings > build.excution
1 console > pyconsole
import sys;
print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])
import numpy as np
import scipy as sp
import matplotlib as mpl
File > settings > Project : initial project
project dependencies > LDA > project depends on these projects > 选择sim_cluster就可以在LDA中调用sim_cluster中的包
Pycharm实用功能:
NOTES:
1 ctrl + shift + f10执行python时,cwd为run/debug configurations 中的working directory
可在edit configurations > project or defaults中配置
2 python console中的cwd为File > settings > build.excution > console > pyconsole中的working directory
并可在其中配置
from:http://blog.csdn.net/pipisorry/article/details/39909057
ref:pycharm的一些设置和快捷键