WHCSRL 技术网

pycharm每日一贴中英文对照(机器翻译)_grmrh的博客

1.To quickly select the currently edited element (class, file, method or field) in any view (Project view, Structure view or other), press Alt+F1.

要在任何视图(项目视图、结构视图或其他视图)中快速选择当前编辑的元素(类、文件、方法或字段),请按Alt+F1。

2.The speed search is available in all the tree views: just start typing and you'll quickly locate the necessary item.

速度搜索在所有的树视图中都是可用的:只要开始键入,您就可以快速找到所需的项。

3.The Esc key in any tool window moves the focus to the editor.
Shift+Esc moves the focus to the editor and also hides the current (or last active) tool window.
The F12 key moves the focus from the editor to the last focused tool window.

任何工具窗口中的Esc键都将焦点移动到编辑器。

Shift+Esc将焦点移动到编辑器,并隐藏当前(或最后一个活动)工具窗口。

F12键将焦点从编辑器移动到最后一个聚焦工具窗口。

4.Ctrl+W (extend selection) in the editor selects the word at the caret and then selects expanding areas of the source code. For example, it may select a method name, then the expression that calls this method, then the whole statement, then the containing block, etc. You can also select the word at the caret and the expanding areas of the source code by double-clicking the target areas in the editor.

在编辑器中Ctrl+W(扩展选择)选择插入符号处的单词,然后选择源代码的扩展区域。例如,它可以选择一个方法名,然后是调用这个方法的表达式,然后是整个语句,然后是包含它的块,等等。您还可以通过双击编辑器中的目标区域来选择插入符号处的单词和源代码的展开区域。

5.The Extract Variable refactoring helps you simplify complicated statements in your code. For example, in the code fragment below, you can select an expression in the code, and press Ctrl+Alt+V (Refactor | Extract | Variable).

Extract变量重构帮助您简化代码中的复杂语句。例如,在下面的代码片段中,您可以在代码中选择一个表达式,并按Ctrl+Alt+V(重构|提取|变量)。

6.Ctrl+D in the editor duplicates the selected block or the current line when no block is selected.

当没有选择任何块时,编辑器中的Ctrl+D会复制所选的块或当前行。

7.The Code | Move Statement Up/Down action is useful for reorganizing the code lines in your file, e.g., for bringing a variable declaration closer to the variable usage.
For example, select a code fragment and press Ctrl+Shift+向上箭头 or Ctrl+Shift+向下箭头.

When there is no selection, the line at the cursor will be moved.

代码|上/下移动语句对于重新组织文件中的代码行非常有用,例如,使变量声明更接近变量用法。

例如,选择一个代码片段,按Ctrl + Shift +向上箭头或Ctrl + Shift +向下箭头。

当没有选择时,光标处的行将被移动。

8.Ctrl+Shift+J shortcut joins two lines into one and removes unnecessary space to match your code style.

Ctrl+Shift+J快捷键将两行合并为一行,并删除不必要的空间以匹配代码样式。

9.If the cursor is between the parentheses of a method call, pressing Ctrl+P brings up a list of valid parameters.

如果光标位于方法调用的圆括号之间,按下Ctrl+P会出现一个有效参数列表。

10.Ctrl+Shift+Backspace (Navigate | Last Edit Location) brings you back to the last place where you made changes in the code.
Pressing Ctrl+Shift+Backspace a few times moves you deeper into your changes history.

Ctrl+Shift+Backspace(导航|的最后编辑位置)将您带回到您在代码中进行更改的最后一个位置。

按下Ctrl+Shift+Backspace几次会使您更深入地了解您的更改历史。

11.Use Ctrl+Shift+F7 (Edit | Find | Highlight Usages in File) to quickly highlight usages of some variable in the current file.
Use F3 and Shift+F3 keys to navigate through highlighted usages.
Press Esc to remove highlighting.

使用Ctrl+Shift+F7(编辑|查找文件中的|高亮用法)快速高亮当前文件中某个变量的用法。

使用F3和Shift+F3键来导航高亮显示的用法。

按Esc删除突出显示。

12.To see your local history of changes in a file, invoke Local History | Show History from the context menu. You can navigate through different file versions, see the differences and roll back to any previous version.
Use the same context menu item to see the history of changes on a directory. You will never lose any code with this feature!

要查看文件中的本地更改历史记录,请从上下文菜单中调用本地历史|显示历史记录。您可以浏览不同的文件版本,查看差异并回滚到任何以前的版本。

使用相同的上下文菜单项查看目录上的更改历史。您将永远不会丢失任何具有此功能的代码!

13.Ctrl+E (View | Recent Files) brings a popup list of the recently visited files. Choose the desired file and press Enter to open it.

Besides recent files, you can bring up results of the usage searches you have performed recently. To do that, use the same Ctrl+E shortcut with the Find tool window having the focus, and select the desired find usages result from the Recent Find Usages popup.

Ctrl+E(查看|最近的文件)会弹出一个最近访问过的文件列表。选择所需的文件并按回车键打开它。

除了最近的文件,您还可以调出您最近执行的使用搜索的结果。为此,使用与Find工具窗口相同的Ctrl+E快捷键,并从最近的Find用法弹出窗口中选择所需的Find用法。

14.To show separator lines between methods in the editor, open the editor settings and select the Show method separators check box in the Appearance page.

要在编辑器中显示方法之间的分隔线,请打开编辑器设置并在外观页面中选择“显示方法分隔符”复选框。

15.When using basic code completion (Ctrl+空格), type any characters that exist anywhere in an identifier.

当使用基本代码完成(Ctrl +空格),输入任何字符存在一个标识符。

16.Use Alt+向上箭头 and Alt+向下箭头 keys to quickly move between methods in the editor.

使用Alt +向上箭头和Alt +向下箭头键之间快速移动方法在编辑器中。

20.Use the Ctrl+Shift+V shortcut to choose and insert recent clipboard contents into the text.

使用Ctrl+Shift+V快捷键选择并将最近的剪贴板内容插入文本。

16.The shortcuts such as Ctrl+Q (View | Quick Documentation), Ctrl+P (View | Parameter Info), Ctrl+B (Navigate | Declaration) and others can be used not only in the editor but in the code completion popup list as well.

快捷键如Ctrl+Q(查看|快速文档)、Ctrl+P(查看|参数信息)、Ctrl+B(导航|声明)等不仅可以在编辑器中使用,还可以在代码完成弹出列表中使用。

17.You can easily override the methods of the base class by pressing Ctrl+O (Code | Override Methods).

您可以通过按Ctrl+O(代码|覆盖方法)轻松覆盖基类的方法。

18.To help you learn the purpose of each item in the main menu, its short description is shown in the status bar at the bottom of the application frame when you position the mouse pointer over this item.

为了帮助您了解主菜单中每个项目的用途,当您将鼠标指针放置到该项目上时,它的简短描述将显示在应用程序框架底部的状态栏中。

20.To open any particular method or field in the editor quickly, press Ctrl+Alt+Shift+N (Navigate | Symbol) and start typing its name.
Choose the symbol from a drop-down list that appears.

要快速打开编辑器中的任何特定方法或字段,请按Ctrl+Alt+Shift+N(导航|符号)并开始键入其名称。

从出现的下拉列表中选择符号。

21.Use Alt+Shift+C to quickly review your recent changes to the project.

使用Alt+Shift+C快速查看你最近对项目的修改。

22.Use Basic Completion (Ctrl+空格) within HTML, CSS and other files, for completing image file names.

使用基本完成(Ctrl +空格)的HTML, CSS和其他文件,完成图像文件的名字。

23.With a single keystroke, you can apply another code style/coloring scheme or keymap right from the editor. Just press Ctrl+` (View | Quick Switch Scheme), to specify the scheme you want to change.

使用单个击键,您可以直接从编辑器应用另一种代码样式/着色方案或键映射。只需按Ctrl+ '(查看|快速切换模式),以指定您想要更改的模式。

23.When in the Go to Class, Go to Symbol, or Go to File popup, you can ease the search by filtering the lookup list with the help of the "camel words" prefixes.

在Go to类、Go to Symbol或Go to File popup中,您可以借助“驼峰单词”前缀过滤查找列表,从而简化搜索。

24.You can easily make column selection by dragging your mouse pointer while keeping the Alt key pressed.

在按住Alt键的同时拖动鼠标指针,可以轻松地进行列选择。

25.You don't need to guess which __init__.py or views.py you are looking at...
Make the editor tabs and the lines in navigation lists stand out using the File Colors page of the Appearance & Behavior settings.

你不需要去猜测你所看到的是__init__.py还是views.py
使用外观和行为设置的文件颜色页面,突出编辑器选项卡和导航列表中的行。

26.If nothing is selected in the editor, and you press Ctrl+C, then the whole line at caret is copied to the clipboard.

如果在编辑器中没有选择任何内容,并按Ctrl+C,则将插入符号处的整行复制到剪贴板。

27.If you don't want to commit some of your changes to the repository, you can set them aside for a while, by moving to a separate changelist, or by putting them to a shelf. Select such file in the Local tab of the Changes tool window, and on the context menu choose Move to another changelist, or Shelve Changes.

您不想将一些更改提交到存储库,您可以暂时将它们搁置,可以移动到一个单独的变更列表,也可以将它们放在一个架子上。在“更改”工具窗口的“本地”选项卡中选择此类文件,然后在上下文菜单中选择“移动到另一个更改列表”或“搁置更改”。

28.You can move any file to a changelist of your choice. To do that, just choose Move to Changelist on the file context menu in the Version Control tool window:

您可以将任何文件移动到您选择的变更列表中。要做到这一点,只需在Version Control工具窗口的文件上下文菜单中选择“Move to Changelist”:

29.You can bring forward the list of all usages of a class, method or variable across the whole project, and quickly jump to the selected usage. To do that, place the caret at the symbol's name or at its usage in code and press Ctrl+Alt+F7 (Edit | Find | Show Usages in the main menu), scroll the list and click the desired usage.

您可以在整个项目中提出类、方法或变量的所有用法列表,并快速跳转到所选的用法。为此,将插入符号放在符号的名称或代码中的用法处,并按Ctrl+Alt+F7(在主菜单中编辑|查找|显示用法),滚动列表并单击所需的用法。

30.To quickly find a menu command or toolbar action, you do not need to look through the menus. Just press Ctrl+Shift+A (Help | Find Action on the main menu) and start typing the name of the action. Choose the desired action from the suggestion list.

要快速查找菜单命令或工具栏操作,不需要查看菜单。只需按下Ctrl+Shift+A(帮助|找到主菜单上的动作),并开始键入动作的名称。从建议列表中选择所需的操作。

31.To quickly find and run an inspection, press Ctrl+Alt+Shift+I and start typing the name of the inspection or its group. Choose the desired inspection from the suggestion list and then specify the desired scope.

要快速查找并运行检查,请按Ctrl+Alt+Shift+I并开始键入检查或检查组的名称。从建议列表中选择所需的检查,然后指定所需的范围。

32.You can quickly find a setting you need in the Settings/Preferences dialog, without browsing through the numerous options. Just type some characters that, in your opinion, exist in the option description, and the list of settings will reduce to the matching ones. Select the desired entry, and see the setting that contains the entered characters highlighted:

您可以在Settings/Preferences对话框中快速找到您需要的设置,而无需在众多选项中进行浏览。只要输入一些您认为存在于选项描述中的字符,设置列表就会减少到匹配的字符。选择所需的条目,然后查看包含高亮显示的输入字符的设置:
 

33.By pressing Alt+Shift+F10 you can access the Run/Debug dropdown on the main toolbar, without the need to use your mouse.

按Alt+Shift+F10可以访问主工具栏上的Run/Debug下拉菜单,而不需要使用鼠标。

36.You can quickly review all styles currently applied to an HTML tag, by right-clicking the tag name and selecting Show Applied Styles For Tag from the context menu:

通过右键单击标签名称,并从上下文菜单中选择Show applied styles For tag,您可以快速查看当前应用于HTML标签的所有样式:

37.You can quickly view the image referenced at caret by using the Quick Definition (Ctrl+Shift+I). The underlying image will be opened in a popup instead of a separate editor tab.

可以使用快捷定义(Ctrl+Shift+I)快速查看插入符号处引用的图像。底层图像将在弹出窗口中打开,而不是单独的编辑器选项卡。

38.It is possible to rename CSS selectors directly from HTML. Position the caret at the selector to be renamed and press Shift+F6 (Refactor | Rename).

可以直接从HTML中重命名CSS选择器。将插入符号放在要重命名的选择器上,然后按Shift+F6(重命名|)。

39.PyCharm simplifies your work with colors in CSS files. The color properties have the icons of the corresponding color in the left gutter area of the editor.
Click color icons to choose the desired color from the color picker.

PyCharm使用CSS文件中的颜色简化了您的工作。颜色属性在编辑器的左侧空白区域有相应颜色的图标。

单击颜色图标,从颜色选择器中选择所需的颜色。

40.Keep your source code typo-free with the help of the built-in Spellchecker.
All texts, including comments, textual strings and literals, are inspected against the pre-defined dictionaries. All typos are highlighted, which leaves you with the task of choosing the correct word, accepting the current spelling, or disabling inspection.
Use Alt+Enter to see the list of available actions.

在内置拼写检查器的帮助下,保持源代码无排版。

所有文本,包括注释、文本字符串和文本,都将根据预定义的字典进行检查。所有的拼写错误都会被高亮显示,这将留给您选择正确的单词、接受当前的拼写或禁用检查的任务。

使用Alt+Enter查看可用操作的列表。

41.If you lack words in the pre-defined dictionaries, you can create your own ones. A custom dictionary is a mere textual file with a .dic extension, with each word starting on a new line.
All you have to do is to point to the directories where your dictionaries are stored, in the Spelling of the Settings dialog.

如果在预定义字典中缺少单词,可以创建自己的字典。自定义字典只是一个文本文件,扩展名为.dic,每个单词都从新行开始。

你所要做的就是在设置对话框的拼写中指向字典所在的目录。

42.A special variant of the Code Completion feature invoked by pressing Ctrl+空格 twice allows you to complete XML tag names from namespaces not declared in the current file. If the namespace is not declared yet the declaration is generated automatically.

调用代码自动完成功能的特殊变体通过按Ctrl +空两格允许您完整的XML标记名称从名称空间不是当前文件中声明。如果名称空间尚未声明,则自动生成声明。

43.For the pattern search in the Go to Class, Go to Symbol and Go to File pop-up frames, use * and space symbols.
* stands for any symbols.
Space at the end means the end of a pattern, and the preceding string will be considered not just a prefix but a whole pattern. The list of the suggested names will be reduced accordingly.

对于Go to类中的模式搜索, Go to Symbol和File弹出框,使用*和空格符号。
*代表任何符号。
结束处的空格表示模式的结束,前面的字符串不仅被视为前缀,而且被视为整个模式。建议名单将相应减少。
44.All your most indispensable VCS commands are just one-click away...
Choose VCS | VCS Operations Popup on the main menu, and get a popup with the VCS commands that are relevant to the current context:

所有你最不可缺少的VCS命令,只需一键之遥…

在主菜单上选择VCS | VCS操作弹出,并得到一个与当前上下文相关的VCS命令弹出:

45.You can comment and uncomment lines of code using Ctrl+/.
Ctrl+/ comments or uncomments the current line or several selected lines with single line comments ({# in Django templates, or # in Python scripts).
Pressing Ctrl+Shift+/ for a selected block of source code in a Django template surrounds the block with {% comment %} and {% endcomment %} tags.

可以使用Ctrl+/对代码行进行注释和取消注释。

Ctrl+/注释或取消注释当前行或若干选定行,并使用单行注释({# in Django templates,或# in Python scripts)。

对于Django模板中选定的源代码块,按下Ctrl+Shift+/将{% comment %}和{% endcomment %}标记包围该块。

46.Navigation bar is a quick alternative to the Project view.
Use Alt+Home keyboard shortcut to show the navigation bar, and arrow keys to locate the necessary files or folders.

导航栏是项目视图的快速替代品。

使用Alt+主键盘快捷键来显示导航栏,使用箭头键来定位必要的文件或文件夹。

47.The Local Changes tab of the Version Control tool window shows all deleted, modified, and unversioned files in a single view. Use  keyboard shortcut to show or hide this tool window.
From the Version Control tool window you can perform all the necessary version control actions: commit changes, manage changelists, put resources under version control, examine differences and more.

版本控制工具窗口的“本地更改”选项卡在一个视图中显示所有已删除、修改和未更改的文件。使用键盘快捷键来显示或隐藏此工具窗口。

在版本控制工具窗口中,您可以执行所有必要的版本控制操作:提交更改、管理更改列表、将资源置于版本控制之下、检查差异等等。

48.When you want to catch exceptions thrown by some code fragment, select it in the editor, press Ctrl+Alt+T (Code | Surround With) and choose try/except. This will automatically generate the except clause.

当您想要捕获一些代码片段抛出的异常时,在编辑器中选择它,按Ctrl+Alt+T(代码| Surround With)并选择try/except。这将自动生成except子句。

49.You can work in the Python or Django shell without leaving the IDE. Just choose Run Python Console or Run Django Console in the Tools menu.

您可以在不离开IDE的情况下使用Python或Django shell。只需在工具菜单中选择运行Python控制台或运行Django控制台。

50.Working in the interactive consoles, you don't need to memorise the command line syntax or available functions. Instead, you can use the familiar code completion Ctrl+空格. Moreover, from within the lookup list, you can press Ctrl+Q to view the item's documentation.在交互式控制台中工作,您不需要记住命令行语法或可用的函数。相反,您可以使用熟悉的代码完成Ctrl +空格。此外,在查找列表中,您可以按Ctrl+Q查看项目的文档。

51.If you have already spent some time working in the interactive consoles, you don't need to re-type the previously entered commands to repeat them. Instead, press Ctrl+向上箭头 and Ctrl+向下箭头 to scroll through the history of commands.如果您已经花了一些时间在交互式控制台中工作,则不需要重新输入前面输入的命令来重复它们。相反,按Ctrl +向上箭头和Ctrl +向下箭头滚动的历史命令。

52.When you press Alt+Enter to invoke a quick fix or intention action, press the right arrow key to reveal the list of additional options.
Depending on the context, you can choose to disable inspection, fix all problems, change inspection profile, etc.

当您按Alt+Enter以调用快速修复或意图操作时,请按右箭头键以显示附加选项列表。

根据上下文,您可以选择禁用检查、修复所有问题、更改检查配置文件等。

53.Ctrl+Click a tab in the editor to navigate to any part of the file path. Select the necessary element in the drop-down, and the corresponding file path is opened in an external browser (e.g., in the Explorer, if your OS is Windows).Ctrl+单击编辑器中的选项卡以导航到文件路径的任何部分。在下拉菜单中选择必要的元素,相应的文件路径将在外部浏览器中打开(例如,在资源管理器中,如果您的操作系统是Windows)。

54.PyCharm lets you jump from your check-in comment to an issue in your task tracker.
All you have to do is to define issue navigation patterns in the Settings | Version Control dialog:PyCharm允许您从签入注释跳到任务跟踪程序中的问题。
你所要做的就是在Settings | Version Control对话框中定义问题导航模式:

55.The easiest way to run a utility of the manage.py task is to choose Run manage.py Task in the Tools menu, or press Ctrl+Alt+R.
As you type the name of the utility you want to run, the lookup list shrinks to show the matching entries only.

运行management .py任务的实用程序的最简单方法是在Tools菜单中选择run management .py任务,或者按Ctrl+Alt+R。

当您键入要运行的实用程序的名称时,查找列表缩小,只显示匹配的条目。

56.It's very easy to navigate between the Django templates and referencing views.
To do that, use the icons in the left gutter of the editor.

在Django模板和引用视图之间导航非常容易。

为此,请使用编辑器左边的图标。

57.Use the Switcher (Ctrl+Tab) to switch between open files and tool windows. Keeping Ctrl pressed, use the Up and Down arrow keys, Tab or Shift+Tab, Alt for navigation; use Delete or BackSpace to close editor tab or hide a tool window.使用切换器(Ctrl+Tab)在打开的文件和工具窗口之间切换。按住Ctrl键,使用向上和向下箭头键,标签或Shift+标签,Alt导航;使用Delete或BackSpace关闭编辑器选项卡或隐藏工具窗口。

58.You can easily open an external file for editing, if you just drag it from the Explorer or Finder to the editor.您可以轻松地打开一个外部文件进行编辑,只要将它从资源管理器或查找程序拖到编辑器即可。

59.There are two ways of closing all tabs in the editor, except the current one:
First, right-click the editor tab, and choose Close Others on the context menu.
Second, keeping the Alt key pressed, click   on the editor tab.

有两种方法关闭所有选项卡在编辑器,除了目前的一个:

首先,右键单击编辑器选项卡,并选择关闭上下文菜单上的其他选项卡。

其次,按住Alt键,单击“编辑器”选项卡。

60.You can jump directly to any deeply buried file, if you press Ctrl+Shift+N, and type just a couple of characters of the enclosing directories and file names:如果你按Ctrl+Shift+N,并键入两个字符的封闭目录和文件名:你可以直接跳转到任何深埋文件

61.To open any class or file in the editor at the desired line, press Ctrl+Shift+N (Navigate | File), start typing the name, and choose the one from the suggestion list. Then type the colon (:) and a line number.
The selected file will open with the caret at the specified line.

要在编辑器中打开所需行的任何类或文件,请按Ctrl+Shift+N(导航|文件),开始键入名称,并从建议列表中选择一个。然后输入冒号(:)和行号。

选定的文件将用插入符号在指定行打开。

62.To view which line separators style is used in the current file, look at the Status Bar:要查看当前文件中使用的行分隔符样式,请查看状态栏:To change the current line ending style, just click the spinner.要更改当前的行结束样式,只需单击spinner。

62.You do not need to open a file in the editor to change its line separator style. Use the Project tool window instead: select one or more files, or folders, point to File | Line Separators on the main menu, and then choose the desired line ending style.
For a directory, new line separator applies recursively.

您不需要在编辑器中打开文件来更改其行分隔符样式。使用项目工具窗口:选择一个或多个文件,或文件夹,指向主菜单上的文件|行分隔符,然后选择所需的行结束样式。

对于目录,新行分隔符递归应用。

文章知识点与官方知识档案匹配,可进一步学习相关知识
Python技能树预备知识常用开发工具29762 人正在系统学习中
推荐阅读