9. Three times class (December 20) 17.3 / 17.4 cellular multi instance 17.5 cellular and scheduled tasks

9. Three classes (December 20) 17.3 / 17.4 cellery multi instance Multiple worker s, multiple queues [root@localhost celery]# cat tasks.py #!/usr/bin/env python #-*- coding:utf-8 -*- from celery import Celery app = Celery() app.config_from_object("celeryconfig") @app.task def taskA(x,y): return x + y @app.task de ...

Posted by neostrife on Tue, 05 May 2020 21:39:28 +0200

Magic method - simple customization (\\\\\\\\\\\\\\\\\\\

Reading notes: Both repr and str are used for display. str is user oriented, while repr is programmer oriented. repr means representation and description. To display objects using print(Object), you need to refactor str. To directly input class objects for printing, you need to refactor the repr. In python, str is us ...

Posted by wing_zero on Tue, 05 May 2020 08:20:42 +0200

LeetCode -- longest substring without duplicate characters

LeetCode -- longest substring without duplicate characters Blog Description The information in this article comes from the Internet and personal summary, which is intended to summarize personal learning and experience. If there is any infringement, please contact me to delete it. Thank you! Explain leetcode Question, Interview 48 The longest ...

Posted by calevans on Sun, 03 May 2020 05:39:23 +0200

RedisLive installation configuration

Installation environment: CentOS release 6.5 (Final) 64 bit 1. Install Python Python 2.6 comes with CentOS, but pip does not support this version. You need to upgrade Python to 2.7 first, and python 2.6 is required for yum, so Python needs to coexist with 2.6 and 2.7 # Install compilation tools and dependency Librari ...

Posted by free2code on Sat, 02 May 2020 08:38:18 +0200

python Programming (multiprocessing Library)

[notice: All Rights Reserved. Please reprint. Do not use for commercial purposes. Contact email: feixiaoxing@163.com] Because there are not many opportunities to write multiple processes, we do not pay much attention to this aspect. Therefore, the multi process code has not been mastered. In fact, from the bottom of my heart, I know that mu ...

Posted by gabereiser on Sat, 02 May 2020 05:18:09 +0200

Python - Implementing SSH Tunneling Function

Please indicate the source of the reprint: http://blog.csdn.net/l1028386804/article/details/78845722 Imagine an environment where you can access an SSH server on your intranet and you also want to access a Web server on the same segment.You cannot access the Web server directly, but SSH servers can access the Web server and there are no tools ...

Posted by k994519 on Fri, 01 May 2020 11:11:52 +0200

Basic part of flash in python framework (3) ------ operation of template

1.flask specific variables and functions: Variables: g, session, request, config Functions: URL for(), get flashed messages(), please pay attention to this function. Remember that it is a function. Don't forget to write brackets!!!!!!!!! I don't need to talk much nonsense. I'll go straight to the code to experience it: First, explain a bug. Whe ...

Posted by keith73 on Fri, 01 May 2020 11:01:27 +0200

Crawling novel (step 3) python

Suppose you have installed bs4 requests This novel is chosen at will, so you don't have to worry too much Python 3 implementation. There are too many crawlers using Python 2 on the Internet, but there are still few crawlers using Python 3 The link is https://www.qu.la/book/12763/10664294.html Get the title of the article (find the exact htm ...

Posted by hnissani on Fri, 01 May 2020 10:30:06 +0200

Case: multi task udp chat

Case: multi task udp chat Explain Write a program with two threads Thread 1 is used to receive data and display Thread 2 is used to detect keyboard data and send data through udp Requirement Achieve the above requirements Summarize the characteristics of multitask program Reference code: import socket import threading def send_msg(udp_socket) ...

Posted by ViperSBT on Thu, 30 Apr 2020 22:54:03 +0200

Python -- an example of business monitoring based on domain name polling

Please indicate the source of Reprint: http://blog.csdn.net/l1028386804/article/details/78965865 Most of DNS resolution is a domain name corresponding to an IP address, but through DNS polling technology, a domain name corresponding to multiple IPS can be achieved, so as to achieve the simplest and most efficient load balancing. However, the b ...

Posted by charlesg on Thu, 30 Apr 2020 20:59:38 +0200