Python orchestration & asyncio & asynchronous programming

Python orchestration & asyncio & asynchronous programming 1. Cooperation The coroutine is a kind of micro thread, and it is a kind of context switching technology of user state. Through a thread, the code blocks can be switched to each other for execution There are several ways to implement a collaboration: greenlet, early modules ...

Posted on Mon, 04 May 2020 21:28:26 -0700 by Dave100

Lost hard disk space: a solution to the statistical inconsistency between du and df

Suddenly, I received an alarm email from Zabbix saying that the hard disk space is in alarm. I quickly boarded the server and checked the utilization rate of the hard disk with df. I found that the used space is indeed low, as follows: # Plus - h makes it easier to see the size of the space df -h The output results ...

Posted on Mon, 04 May 2020 11:15:08 -0700 by kylevisionace02

EffectivePython: str and bytes, generator expression, enumerate

1. Thinking in a pythonic way """View version""" import sys print(sys.version_info) print(sys.version) sys.version_info(major=3, minor=6, micro=3, releaselevel='final', serial=0) 3.6.3 |Anaconda custom (64-bit)| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)] """Modify path""" import os os.getcwd() os.chdir(r'C:\Users\Xiao ...

Posted on Mon, 04 May 2020 08:09:56 -0700 by bubblenut

Python MQTT client implementation

Python MQTT client implementation If you need to reprint, please indicate the source: http://blog.csdn.net/itas109 QQ technology exchange group: 12951803 1. Install PAHO mqtt Using Python Package Index (PyPi) pip install paho-mqtt Using virtualenv virtualenv paho-mqtt source paho-mqtt/bin/activate pip install paho-mqtt Or comp ...

Posted on Mon, 04 May 2020 04:51:36 -0700 by jeffshead

The branch and cycle of Python 3

1: Conditional branch if condition: Statement else: Statement 2. Abbreviation else:   if : It can be abbreviated to elif, so Python can effectively avoid "hanging else" give an example: #suspension else score = int(input('Please enter a score:')) if 80 > score >= 60: print('C') else: if 90 > score >= 80: ...

Posted on Mon, 04 May 2020 03:51:37 -0700 by shibbi3

django -- Celery implements asynchronous and timed tasks

1. Environment python==2.7 djang==1.11.2 # 1.8, 1.9, 1.10No problem celery-with-redis==3.0 # redis needs to be used as an intermediary service (Broker) celery==3.1.25 # Installing the above will install automatically kombu==3.0.37 billiard==3.3.0.23 django-celery==3.2.2 # Cellery plug-in, to achieve timed task ...

Posted on Sun, 03 May 2020 23:20:52 -0700 by scheols

matplotlib implements the display of two pictures on the same page, and zooms and drags the pictures separately

The requirements are as follows: 1. Show two pictures in one page 2. You can use the mouse to drag their own pictures into the page without affecting each other 3. After entering the page, you can use the mouse wheel to enlarge or reduce the pictures, which are not affected by each other. That is to say, when you move the mouse over picture A, ...

Posted on Sun, 03 May 2020 21:57:01 -0700 by RazorICE

python 3.x learning note 7 (module)

1. Definition:Module: used to logically organize Python code (variable, function, class, logic: implement a function), which is essentially a python file at the end of. pyPackage: to organize modules logically, the essence is a directory (must have a "init". Py file) 2. Import methodimport module_name1,module_name2 from module import ...

Posted on Sun, 03 May 2020 21:13:18 -0700 by WellBaffled

List of Python learning 1

Python learning 1 Built in method 1 increase append() append after the list list=[12,"123"."xiaoming"] list1.append("heihei")#Append after list print(list) #output[12,"123"."xiaoming","heihei"] insert(index, "content") add anywhere list=["Zhang San","lisui","wangwu"] list.insert(2,"zhaoliu") print(list)#Output["Zhang San", ...

Posted on Sun, 03 May 2020 08:26:05 -0700 by wee493

Use Python to execute the executable jar package.

There are many ways to execute jar generated by Spring boot. Here is the most commonly used example. In the environment with java, you can run the spring boot project directly by using the following command java -jar app.jar One disadvantage of this method is that it can't run in the background. In this case, you need to use a nohup command ...

Posted on Sun, 03 May 2020 08:06:06 -0700 by Atomic Taco