当前位置:网站首页>System performance monitoring system
System performance monitoring system
2022-06-13 05:13:00 【I love Qianxi】
use python To write scripts to simplify the daily operation and maintenance work is python An important use of , stay linux in , It can be used ps,top,free Such a command to view , stay python in , A good way to get system information is psutil This third-party module , It is python System monitoring and process management tools , It is a powerful cross platform system management library , at present psutil The supported systems are linux,window os X etc.
One 、requests Request Library
1、 Introduce
requests Is an elegant and simple python HTTP Request Library ,requests Send request to get response data
2、 install
At terminal ( Command line tools ) Run the following command
pip install requests
pip list Can view installed Libraries
Be careful :
1、 If you want to install python In a virtual environment , Enter the virtual environment first, and then execute the above command
2、 If both... Are installed in the system python2, Installed again python3, Need to install python3 Environment :pip3 install requests
3、requests Basic use
1、 The import module
2、 send out get request , Get a response
3、 Get data from the response
1、 The import module
import requests
2、 Send a request , Get a response
response=requests.get("http://www.baidu.com")
3、 Get data from the response
print(response.text)
response Common properties :
response.test: Response string data
response.encoding: The character encoding used for printing
response.content: Print the binary data of the response
Set the code to utf-8:response.encoding="utf-8"
边栏推荐
- Chapter 2 process management
- Case -- the HashSet set stores the student object and traverses
- Advanced C language - Section 1 - data storage
- Chapter 18 pagination: Introduction
- metaRTC4.0集成ffmpeg编译
- Advanced C - Section 2 - pointers
- Dynamic and static libraries
- Clause 33: decltype is used for auto & type formal parameters, with std:: forward
- C language learning log 10.11
- float类型取值范围
猜你喜欢

QT signal is automatically associated with the slot

Chapter 13 abstraction: address space

C language learning log 1.22

metaRTC4.0集成ffmpeg编译

Bomb disposal cat

Case - random numbers without repetition (HashSet and TreeSet)

Section 6 - pointers

Luogu p1036 number selection

Stepping on a horse (one stroke)

QT realizes message sending and file transmission between client and server
随机推荐
Brick story
Bomb disposal cat
Opencv image storage and reading
Metaltc4.0 stable release
行情绘图课程大纲1-基础知识
Bm1z002fj-evk-001 startup evaluation
Advanced C language - Section 1 - data storage
Chapter 18 pagination: Introduction
Section 6 - pointers
OpenCV中的saturate操作(饱和操作)究竟是怎么回事
C language learning log 1.17
Leetcode game 297 (20220612)
Elliptic curve encryption
[reprint] complete collection of C language memory and character operation functions
Small project - household income and expenditure software (2)
Clause 30: be familiar with the failure of perfect forwarding
C language learning log 10.5
Dynamic and static libraries
Chapter 15 mechanism: Address Translation
lookup