Django Learning Notes 1 - Installation Configuration

Django is an open source Web application framework written in Python. There are many web frameworks in python, such as Django, Tornado, Flask. Django has many advantages over other WEB frameworks: large and complete, the framework itself integrates many functions such as ORM, model binding, template engine, caching, Session, etc. Django uses t ...

Posted by warstormer on Sun, 29 Dec 2019 23:00:59 -0800

Save all bicolor numbers to MySQL

Save all bicolor numbers to MySQL   1, function This code mainly saves all data of dichroic sphere to mysql database, and the total type of dichroic sphere is 17721088. The 8G I7 notebook of the author has been inserted for about 10 days. The following code contains two methods: Insert_SSQ and Insert_SSQ2. The former inserts ...

Posted by clodagh2000 on Thu, 26 Dec 2019 07:06:41 -0800

Flask Learning Tour - Paging Function: Use flask--pagination and layPage plug-in respectively

1. Preface Paging is a common feature in the development of a Web site, especially when a certain amount of data is displayed on the page, which can cause pages to be too long and affect the user experience. In addition, slow loading may occur.Therefore, paging is necessary. There are two common implementations of paging: foreground paging and ...

Posted by TexasMd91 on Tue, 24 Dec 2019 18:47:13 -0800

[syntax 14] Python MySQL connector driver

MySQL is the most popular relational database management system. In this chapter, we will introduce you to use MySQL connector to connect and use mysql. MySQL connector is the official drive provided by mysql. We can use the pip command to install MySQL connector: python3 -m pip install mysql-connector Use the following code to ...

Posted by jabapyth on Tue, 24 Dec 2019 13:35:29 -0800

Zabbix4.0 Pins, Mail, WeChat Alarm

1. zabbix Mail Alarm SettingsPrinciple: After breaking the alarm, you can configure corresponding actions, in which you can send mail, WeChat, pins, text messages, etc.Place the alert script in Configuration/usr/local/zabbix/etc/zabbix_server.conf LogFile=/usr/local/zabbix/zabbix_server.log DBHost=127.0.0.1 DBName=zabbix DBUser=zabbix DBPassw ...

Posted by newbiez on Mon, 23 Dec 2019 13:09:36 -0800

Python uses openpyxl to operate excel tables

I. use of openpyxl pip install openpyxl Step 1: open the Workbook (read all the data in the Excel file and save it as a workbook object) workbook = openpyxl.load_workbook('cases.xlsx') Step 2: select the form object sheet = workbook['login'] Step 3: select a form to read data ① read content (line 5, column 4) data = sheet.cell(row=5,column=4) p ...

Posted by thewooleymammoth on Wed, 18 Dec 2019 13:00:43 -0800

Python uses PyExecJS library to execute JS functions

                             . There are three solutions to this problem: ① understand the encryption process of the front-end, and then write these methods (or find open source source code) with scri ...

Posted by christophe on Tue, 17 Dec 2019 04:04:37 -0800

Crawler: XPath, lxml module

1. XPath 1.1 What is XPath XPath (XML Path Language) is a language for finding information in XML and HTML documents, which can be used to traverse elements and attributes in XML and HTML documents. 1.2 XPath Development Tools 1.2.1 Chrome Plugin XPath Helper https://jingyan.baidu.com/article/1e5468f94694ac484861b77d.html 1.2.2 Firefox Plugin X ...

Posted by Marsha on Mon, 16 Dec 2019 21:30:53 -0800

Crawler: requests module

1. requests module 1.1 introduction to requests Requests is a powerful, simple and easy-to-use HTTP request library. Compared with the previously used urllib module, the api of requests module is more convenient. (the essence is to encapsulate urlib3) You can use the pip install requests command to install, but it is easy to have network proble ...

Posted by neogemima on Sun, 15 Dec 2019 21:06:05 -0800

Ubuntu replacement and use of apt source and python source (only applicable to zju intranet)

Ubuntu replacement and use of apt source and python source.md One click change script content #! /bin/bash echo "Set up image source of Zhejiang University" (cat << EOF deb http://mirrors.zju.edu.cn/ubuntu xenial main universe restricted multiverse deb http://mirrors.zju.edu.cn/ubuntu xenial-security main universe restricted multiverse de ...

Posted by shedokan on Sun, 15 Dec 2019 10:24:24 -0800