In : import asyncio
In : async def f(i):
...: await asyncio.sleep(i)
In : async def func():
...: tasks = 
...: for i in range(10):
...: await asyncio.sleep(0)
...: print('create process parameter ', i)
...: tasks.append(asyncio.crea ...
Posted by ShanesProjects on Thu, 05 Dec 2019 09:14:47 -0800
This demo implements:
Chat via command line
The specific logic is in websocket.go
The core here is the global variable aliveList, which is responsible for distributing messages to clients. Events are passed through channel s to reduce blocking
A single link will be registered in the Livelist, and ConnL ...
Posted by coderage on Sun, 01 Dec 2019 05:49:22 -0800
faker creates fake data
In our work, sometimes we need to forge some fake data. How to use Python to forge these seemingly true fake data?
Python has a package called Faker, which can be used to easily forge names, addresses, phone numbers and other information.
Posted by james182 on Sat, 30 Nov 2019 10:09:12 -0800
Before installation, please ensure that your server can access the Internet normally, and the firewall is closed. Turn off selinux
1. Supervisor installation
yum install python-setuptools //Installation dependency
mkdir /etc/supervisord.d/ //Create directory
Posted by sunnypal on Sat, 30 Nov 2019 08:53:55 -0800
Note that since the supervisor cannot monitor the background program, all commands executed by the command need to be executed in the foreground, such as nginx: command = /usr/local/bin/nginx -g 'daemon off;'
Talk about the benefits of this tool:Manage your process, terminate the automatic restart service process abnormallyTurn off the machine ...
Posted by nwoottonn on Fri, 29 Nov 2019 10:20:32 -0800
In addition to installing some commonly used monitoring software, the monitoring of the server sometimes needs to run some shell or Python scripts; under the shell, you can use the system's own shell commands such as ps/free/top/df, and python can call subprocess and other modules to run shell commands, but it is more troublesome to do so. Here ...
Posted by cwetherbee on Fri, 29 Nov 2019 05:48:58 -0800
TOTP is a time-based one-time password generation algorithm, which is composed of RFC 6238 Definition. Different from the event based one-time password generation algorithm HOTP TOTP is time-based and has the following relationship with HOTP:
TOTP = HOTP(K, T)
HOTP(K,C) = Truncate(HMAC-SHA-1(K,C))
T: T = (Current Unix time - ...
Posted by Yippee on Sun, 24 Nov 2019 13:04:35 -0800
Written in front
It's hard to write ~ but teacher fan didn't even let me run ~ I'm dry!It adopts the storage mode of structure array.
Title: bed allocation
A hotel has N rooms, K rooms have a (k), and each room has B (k) single beds. The program of allocating beds for single passengers and withdrawing beds when leaving the hotel is designed by ...
Posted by czs on Thu, 21 Nov 2019 06:10:41 -0800
yum install epel-release
yum install -y supervisor
2. Configuration fileAfter the supervisor is installed successfully, no default configuration file is provided. You can generate the initialization configuration file of the supervisor by running the echo supervisor conf program
echo_supervisord_conf &g ...
Posted by Valdhor on Tue, 19 Nov 2019 12:13:26 -0800
1. What is RPCRPC is a way of communication between processes, the full name is "remote call procedure".When a client sends a request to the server, it is not sent directly to the target server, but to the RPC Server, which schedules it.RPC provides remote calling methods that are no different from calling local methods.
2. Introduct ...
Posted by Eddie Fisher on Sun, 17 Nov 2019 13:45:17 -0800