Python docx operation word file (*. Docx)
Catalog
Basic operation
Object relationship
Add styles
Chinese font Microsoft YaHei, Western Font Times New Roman
text-indent
Style title separately
Set hyperlink
Reference document
Basic operation
from docx import Document
from docx.shared import Inches
# ...
Posted by GarroteYou on Fri, 22 Nov 2019 11:23:17 -0800
Script automation shut Down the Down host in Zabbix
Next, I use Python to shut Down the Down hosts in Zabbix through py Zabbix API. The basic idea is
1. Obtain the IP of the previous group
2. Verify whether the host is Down through telnet
3. Shut down the host
Warning: the python script relies heavily on telnet connectivity results. If the network is unstable, the results will be directly affe ...
Posted by Ozzapoo on Fri, 22 Nov 2019 06:07:57 -0800
Before request and after request in Flask
Catalog
1. Premise, disadvantages of decorator
2. Before & after request
2.1 before Ou request analysis:
2.2 after request analysis:
3. Before you request application
4. Before you request application
5. Implement a simple page login with flash
If one day the b ...
Posted by yarub on Fri, 22 Nov 2019 04:43:50 -0800
python: front end (HTML) + back end (Django) + database (MySQL)
1. Create an html file for a simple web page registration demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>register</title>
</head>
<body><!--Form field action Used to submit acquired to background address-->
<form action="save" method="get"> ...
Posted by curtis_b on Thu, 21 Nov 2019 07:45:04 -0800
Python uses PyYAML library to read and write yaml configuration files
I. yaml file introduction
yaml is a special language for writing configuration files.
1. yaml file rules
Case sensitive;
Use indents to represent hierarchical relationships;
Indent with spacebar instead of Tab
The number of indented spaces is not fixed, only the left side of elements of the same level needs to be aligned;
The strin ...
Posted by slevytam on Thu, 21 Nov 2019 05:51:53 -0800
python Foundation (36):pymysql module
1. pymysql module
Before using pymysql module, you need to learn database MySQL: MySQL Foundation.
1.1 download and use of pymysql
After reading the MySQL foundation, we all operate the database through mysql, the command-line client tool of MySQL. How to operate the database in the python program? This uses the pymysql module, which is essent ...
Posted by gazever on Thu, 21 Nov 2019 02:46:11 -0800
os of common Python modules
os.getcwd()
Return the absolute path to the current working directory
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import os
>>> print(os.getcwd())
C:\Users\28914\AppData\Local\Programs\Python\Python37
os.chdir( ...
Posted by tony_l on Wed, 20 Nov 2019 21:12:02 -0800
python-selenum3 day 6 - WebDriver common API s
1. Loop through all drop-down list values2. Radio drop-down list3. Selection and cancellation of multi selection list4. Operate the radio box, multi box, assert and select all5. Assert keywords in page source code6. screenshots7. Drag page elements
1. Loop through all drop-down list values
<!--Practicing html-->
//Education back ...
Posted by pillot1005 on Wed, 20 Nov 2019 12:24:42 -0800
Linux deleted python by mistake, resulting in the unavailability of yum. Delete the reinstallation method.
Linux system is CentOS Linux release 7.4.1708
Python is deleted by manual, manual, and manual, which makes yum unavailable. Baidu, after reinstalling yum and python, always reported all kinds of errors. After suffering, I finally summed up a set of personal tests, which can be used and shared.
Uninstall existing python firs ...
Posted by stereo on Wed, 20 Nov 2019 09:48:02 -0800
Python Basics - functions
A function, also known as a method, is a piece of code used to implement a specific functionFunction to improve code reusabilityFunction must be called to executeThe variables defined in the function are local variables. Local variables can only be used in the function and cannot be used outside the functionA function does only one thing
import ...
Posted by Riparian on Wed, 20 Nov 2019 07:27:11 -0800