These 42 Python examples are too distracting~

Say goodbye to boredom and learn a Python example in 60 seconds. In the past 1 month, I've changed the code snippets I usually use into small examples, and I've been liked by all of you after sharing them. 1, Basic operation .     1 chain comparison   i = 3 print(1 < i < 3)  # False print(1 < i <= 3)  # True Without else and ...

Posted on Fri, 03 Jan 2020 05:47:15 -0800 by SureFire

nginx to build python-based web Environment

Preface:   Before we start, let's comb the web service workflow and see the following image: 1. Users (PCs) make http requests to web servers 2. If the web server determines whether a user requests a file to be static, it reads the static file directly and returns it to the user, not drops the request to the web framework (django) code process ...

Posted on Fri, 03 Jan 2020 01:52:40 -0800 by amites

Part 3: thoroughly solve the Chinese problem returned by ssh.invoke_shell()

Next, in the first two articles, the problem of solving Chinese is mainly to do something about character set, that is, to convert Chinese into English. But there is a situation that we can't do it before, that is, when we log in, the server directly returns Chinese content: At this time, the program reported the following error, which is actu ...

Posted on Thu, 02 Jan 2020 23:38:06 -0800 by phpocean

Write a translation crawler in Python

python version 3.7 The main function is to connect Daoist translation to Chinese English translation (other languages have not yet tried) And then, just post the code import urllib import urllib.parse import hashlib import time import random headers = { 'Cookie': 'OUTFOX_SEARCH_USER_ID=-2022895048@10.168.8.76;', 'Re ...

Posted on Thu, 02 Jan 2020 21:17:12 -0800 by nanobots

python connects to postgresql database for CRUD operation

Before executing a python program, make sure that the relevant SQL statements can run normally in postgresql Basic SQL statement Create table create table student(id serial primary key,student_name varchar(20),age int ,class_name varchar(20)); Delete table drop table student; Add data (C-create) insert into student (st ...

Posted on Thu, 02 Jan 2020 20:56:42 -0800 by rayner75

Linux upgrade python version

Download the python version to be upgraded, such as: wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz Install required environment components yum -y install readline-devel sqlite-devel bzip2-devel.i686 openssl-devel.i686 gdbm-devel.i686 libdbi-devel.i686 ncurses-libs,zlib-devel.i686 libffi-devel To avoid conflicts with the origi ...

Posted on Thu, 02 Jan 2020 14:37:55 -0800 by andreasb

Statistics of word frequency in romance of the three kingdoms-4

Source: Python Programming Lecturers: song Tian, Huang Tianyu, Li Xin hamlet novel download path: https://python123.io/resources/pye/threekingdoms.txt Statistics of word frequency of romance of the three kingdoms-3: https://blog.csdn.net/Mzjuser/article/details/82527464 Statistics of word frequency of three kingdoms-2 ...

Posted on Thu, 02 Jan 2020 09:31:37 -0800 by dwees

Summary of MySQL 5.7 (json type)

Recently, we know that mysql has added a new field type: json since version 5.7 So a 5.7 version is installed on CentOS 6.5 for normal test #----------------------------------------------------------------------# # Modify yum source to aliyun # Backup first: mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup # Dow ...

Posted on Thu, 02 Jan 2020 04:56:56 -0800 by Gmunky

saltstack establishes top master host

By setting up the top master host to manage the salt master and its salt minion node, and at the same time, it can expand the salt master horizontally, so that one or several top masters can manage multiple salt masters and their salt minions, and realize large-scale cluster management (all host ip in this paper are 172.25.17 n ...

Posted on Wed, 01 Jan 2020 21:22:41 -0800 by rdub

Linear regression -- shangxuetang - artificial intelligence development course

Portal: AI video list - shangxuetang After clicking on any one of them, you will find that they will provide a series of courses integrated with Baidu online disk download, including video + code + materials, which are free Here: Blog Garden Tips , I think it's fun and can be used. The first method is to use numpy to use the mathematical method ...

Posted on Wed, 01 Jan 2020 01:58:51 -0800 by burzvingion