Use of Pycharm external tools

For a powerful IDE such as PyCharm, if everything needs to be operated manually by yourself, it is also too small to use. Recently, I saw that it has an external tools function. It ’s easy to use after trying it. Let ’s talk about usage.

1. Add shortcuts to external tools

Click File-> Settings, find the Tools option, and click the "+" sign:
Insert picture description here
a window pops up.
Insert picture description here
We use the ui to py format written by Qt as an example:
Name is the name of the current custom shortcut. We named it pyuic, and the Group defaults to Yes, Description is a specific description of the currently added shortcut operation, you can choose not to fill in.
The following is the most important part. Program is the location of the currently used program. Copy the program path directly. I am here python.exe. The next line Arguments is the parameter. If there is no parameter, it is not filled in. The command I use here is python -m PyQt5.uic.pyuic $ FileName $ -o $ FileNameWithoutExtension $ .py, the reference in the command selects
Insert picture description here
FileNameWithoutExtension through the Insert Macro at the back to indicate the file name without the extension.
Finally, set the working directory to $ FileDir $, or in Choose from the Macro behind.

The final effect
Insert picture description here
after setting is as follows: after clicking OK, pyuic will appear in the list.

Second, use tools

Right-click the ui file to be converted and click the pyuic shortcut to generate the corresponding py file in the current directory:
Insert picture description here
add other tools and use similar methods.

Published 13 original articles · won 13 · views 3157

Guess you like

Origin blog.csdn.net/weixin_41076275/article/details/105394178