In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how to use File Watchers in Pycharm". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to use File Watchers in Pycharm.
1. Theme
The use of file watcher in PyCharm is introduced in detail.
2. Preparatory work
(1) Pycharm version 3.1 or higher
(2) the File Watchers plug-in is available, which should be installed by default when installing Pycharm (if not, you need to install it manually, see product documentation for details):
(3) be familiar with the main points of use in advance. See Using File Watchers.
(4) in this tutorial, we will deal with LESS and CoffeeScript files. It is recommended to do some preparation work in advance.
3. Install the Node.js plug-in
First, you need to download and install the Node.js plug-in. Open the Plugins page of IDE settings and search for the corresponding plug-ins:
After the installation is complete, restart Pycharm.
4. Install LESS and CoffeeScript compilers
There are two ways to install these two compilers:
(1) first, manual installation. Open local terminal (click the Terminal window button on the lower edge of the PyCharm window) and use the npm command to install LESS and CoffeeScript:
(2) second, use the Pycharm interface to install: click the settings button on the main toolbar, and click the green plus sign on the Node.js and NPM page:
In the Available Packages dialog box, select the library you want to install (select less here), and click Install Package:
After the installation is completed, the relevant compiler files are written to the root directory of the project:
These files will be used later.
5. Configure File Watchers
This step is done automatically by Pycharm.
6. Configure the corresponding file watcher for the LESS file
If the configuration is not made, Pycharm will give an error message after opening the LESS file:
Click the Add watcher connection button, select the executable type of file watcher in the pop-up dialog box (select LESS here), and specify the build format from standard output:
Through this configuration window, you can get a general idea of the actual functions of file watcher.
(1) monitor the changes of all LESS files in the project
(2) use external extensions to compile files, generally using the lessc.cmd compiler defined in the Program domain.
7. Configure the corresponding file watcher for the CofeeScript file
If there is no corresponding configuration, Pycharm will also give an error message after opening the CofeeScript file:
Click the Add watcher connection button and select the executable type of file watcher in the pop-up dialog box (select CoffeeScript here):
Through this configuration window, you can get an overview of the actual functions of file watcher:
(1) track the changes of all CoffeeScript files in the project.
(2) use the external extension .compiler to compile the file in the external extension extension .js, generally using the coffee.cmd compiler defined in the Program domain.
(3) use the external extension .compiler to compile the file in the external extension extension .map, generally using the coffee.cmd compiler defined in the program domain.
8. Edit file watcher
Open the LESS file and make some changes, such as renaming the variable @ myColor to @ Color, and changing its value. File watcher immediately processes the changed file and turns it into an output file through external .css:
Next, open and edit the CoffeeScript file, make some modifications, such as changing the value of the opposite variable, and file watcher generates a JavaScript file and a mapping source file:
Notice that PyCharm displays both the build file and the source file in the project window.
9. Is there a problem?
If the execution of File Watcher fails, PyCharm will give a prompt to help correct:
Thank you for your reading, the above is the content of "how to use File Watchers in Pycharm". After the study of this article, I believe you have a deeper understanding of how to use File Watchers in Pycharm, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.