This article mainly introduces the typecho plug-in compiling tutorial (3): Saving the configuration. This article describes the complete method, how to save the configuration, and precautions for use, you can refer to the previous section to create a bare plug-in. Let's start working on the plug-in!
I. Improvement Methods
Two methods
We implement the activate and deactivate methods.
The Code is as follows:
Public static function activate (){Return '
Tutorial on writing typecho plug-ins (3): Save configuration and typecho plug-ins
We created a bare plug-in the previous section. Let's start working on the plug-in!
I. Improvement Methods
Two methods
We implement the activate and deactivate methods.Copy codeThe Code is as follows:Public static function activate (){Return 'activate ';}
Public static function deactivate (){Return 'activated ';}As shown in th
", response Self. Finish () defMethod_while( Self, *arg, **args): Callback (1)This is what I wrote a request to process the Handler,get request to add the two adorners, the first adorner indicates that the GET function is not automatically cut off the output stream, you need to explicitly call the finish method.This decorator needs to be used with @tornado.gen.engine. The point is, to see @tornado.gen.engine's source def.engine(func):@functools. Wraps(func) defwrapper(*args, **kwargs): Runner =
Typecho Plugin Authoring Tutorial (iii): Save configuration
This article mainly introduces the Typecho plug-in writing tutorial (three): Save the configuration, this article explains how to improve the method, how to save the configuration, the use of the need to pay attention to the issues and other content, the need for friends can refer to the following
The previous section we made a bare plug-in, below we began to let our plug-in began to work!
I. Ways to Improve
Two methods
We implement th
:(Test_env01)$ pip Install Pyaml Now, a pip List gives: (Test_env01)(1.2.1 (1.5.6 (14.05.7 (3.11 (3.6) To deactivate the virtual environment, we type exactly "what do you ' d expect:(TEST_ENV01) $ deactivate$And we get back to the normal command prompt. However, now theWorkon command would show the virtual environment that we created:$ workontest_env01$To start working in it again, simply try out the fo
Install the python Virtual Environment vitrualenv and virtualenvwrapper in windows,
'''Vitrualenv installation and configuration vitrualenv is a py virtual runtime environment step 1 Installation Method on the windows cmd Terminal Use input: pip install virtualenv Step 2 create a virtualenv project environment enter virtualenv testvir (Environment name) on the cmd Terminal) step 3 go to the new environment directory and start the virtual environment cd testvir \ Scripts \ (activate under this d
understand the details.
Now lookMy_project_venvDirectory, you will see this structure:
# Only the directories and files to be discussed are listed here. | -- bin | -- activate #
Run the following command to activate virtualenv:
$ cd my_project_venv$ source bin/activate
After the execution is completed, the prompt may look like this:
(my_project_venv)$ # the virtualenv name prepended to the prompt
Run the deactivate command to exit the virtualenv env
folder named my_project_venv to store your new independent Python environment. The -- distribute option enables virtualenv to use the release-based package management system instead of the packages obtained by setuptools. What you need to know now is that the -- distribute option will automatically install pip in the new virtual environment, so you do not need to install it manually. When you become a more experienced Python developer, you will understand the details.
Now let's take a look at t
The previous section we made a bare plug-in, below we began to let our plug-in began to work!
I. Ways to Improve
Two methods
We implement the Activate and Deactivate methodsCopy the Code code as follows:public static function activate () {return ' activate ';}
public static function deactivate () {return ' deactivated ';}As shown in the code above, we have a return value in the Activate and unload plug-in
end the self-launched app1.4 Methods of prohibiting self-booting1.4.1 Forcestoppackagedisabling by Forcestoppackage will not only deactivate the app's components, but also stop his timer, for the same time, the system privileges and the systems signature are required. 1.4.2 Disabling Component methodsThe Android documentation for Android components has for example the following descriptive narration:theThat is, we can set whether a component is enabl
Install the virtual environment when the problem encountered, the process is very disturbing, here simple and direct sharing, is to solve the problem.Install the virtual environment (must be in the networked state)$ sudo pip install virtualenv$ sudo pip install virtualenvwrapperAfter installing the virtual environment, if you are prompted to not find the mkvirtualenv command, you must configure the environment variable:# 1、创建目录用来存放虚拟环境mkdir $HOME/.virtualenvs# 2、打开~/.bashrc文件,并添加如下:export WORKON
):$ virtualenv -p D/python27/python2.7 my_project
1
To get started with a virtual environment, it needs to be activated:$ my_project/Scripts/activate
1
The name of the current virtual environment will be displayed to the left of the prompt (for example (My_project) your computer: your project username $) to let you know that it is active. From now on, any package you install with PIP will be placed in the My_project folder, isolated from the globally installed Python
How to solve 360 speed browser CPU utilization high computer card slow
This situation is not because the computer configuration is low, but because the 360 speed browser to play video, or enter the Web site with Flash content, need to use flash playback plug-ins. There are two problems that can lead to extremely high CPU utilization:
1. The browser does not call the browser's built-in flash plug-in, but constantly calls the system installed Flash software, resulting in high CPU utilization.
2
developed package.List 1.4 Viewing the version of PIP$ pip --versionpip 9.0.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)List 1.5 Install Virtualenv package with PIP$ sudo pip install virtualenvHow to use 1.1.3 virtualenvList 1.6 View version of Virtualenv$ virtualenv --version15.1.0List 1.7 View current installation version with PIP freeze$ pip freezechardet==2.3.0defer==1.0.6psutil==3.4.2pygobject==3.20.0pysqlite==2.7.0python-apt==1.1.0b1+ubuntu0.16.4.1python-debian==0.1.27pyxdg=
sudo apt-get install python-virtualenv
Virtualenv Py2
CD Py2
CD bin
Start the virtual environment: source Activate
Deactivate
Virtualenv-p/usr/bin/pyhon3 Py3
CD Py3
CD bin
SOURCE Activate
Pip Install Virtualenvwrapper
Find virtualenvwrapper.sh script sudo find/-name virtualenvwrapper.sh
Copy path
VI ~/.BASHRC last line add
Export Workon_home= $HOME/.virtualenvs
SOURCE/Path
Save
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.