Analysis of Python 3. X: paramiko module

First, the first application of this module SSH client Here is a simple code to understand import paramiko # Instantiate an ssh client object ssh = paramiko.SSHClient() # Automatically add the machine you want to connect to in know_host, ignore this verification, and pay attention to the passed parameter paramiko.AutoAddPolicy() ...

Posted by huszi001 on Tue, 31 Mar 2020 22:12:49 -0700

Python learning notes (13) Python functions (1)

Function foundation Function: a function is an organized, reusable code segment used to implement a single or associated function. Function can improve the modularity of application and the reuse rate of code. Python provides many built-in functions, such as print(). You can create your own functions, which are called user-defined functions. De ...

Posted by Wardy7 on Tue, 31 Mar 2020 21:54:52 -0700

Python+Selenium notes (12): data driven testing

(1) Foreword Through the use of data-driven testing, the input value and expected results can be parameterized. (for example: input data and expected results can directly read the data of Excel document) (2) ddt The ddt library can parameterize the variables in the test. When using ddt, use @ ddt decorator on the test class and @ data decorator ...

Posted by viko20 on Tue, 31 Mar 2020 17:41:15 -0700

What is tail recursion?

50% of algorithm problems can be solved by recursion, which is not to say how powerful recursion itself is, but to say that recursion makes many complex problems simple! Why? People who understand data structure know that tree structure itself is defined by recursion What is tail recursion? As we all know, recursion will record ...

Posted by redsox8185 on Tue, 31 Mar 2020 17:15:08 -0700

Python learning notes (8) Python list (2)

List function Append and expand list.append() appends a new object to the end of the list 1 >>> dir(list) #Dirfunctions for viewing lists 2 ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__delslice__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getslice__', '__gt__', ...

Posted by TheWart on Tue, 31 Mar 2020 13:48:32 -0700

Conquer python3 function

function Functions are organized, reusable code snippets that implement a single, or associated function. 1. Definition of function def test(): #function print("in the test") return 0 def test1(): #process print("in the test1") x=test() y=test1() print(x) print(y) 2. Significance of using ...

Posted by owned on Tue, 31 Mar 2020 11:13:47 -0700

Related use of Python requests Library

Related use of requests Library More dry cargo Distributed Combat (dry goods) spring cloud combat (dry goods) mybatis combat (dry goods) spring boot combat (dry goods) React introduction actual combat (dry goods) Building a small and medium-sized Internet enterprise structure (dry goods) python learning continuous update Elast ...

Posted by aron on Tue, 31 Mar 2020 10:35:58 -0700

Data structure and algorithm linked list(03)

Continue with the algorithm of linked list:   Delete duplicate elements in sorted list Given a sort list, delete all duplicate elements so that only one is left for each element.   Case study: Given 1 - > 1 - > 2, return to 1 - > 2 Given 1 - > 1 - > 2 - > 3 - > 3, return to 1 - > 2 - > 3   Solutions: This problem is v ...

Posted by jspodisus on Tue, 31 Mar 2020 10:06:24 -0700

Compile and install vim8 under centos7, and support python3

1. Install python3 vim7.4 and python2.7 are installed by default in CentOS 7. Now we want to install vim8 and make it support python3. First of all, you need to install python3 in the system. For specific installation steps, please refer to my previous blog: https://blog.csdn.net/geerniya/article/details/79263846 2. Compile ...

Posted by ltd on Tue, 31 Mar 2020 05:04:47 -0700

Python web crawler notes (3): Download blog garden essay to Word document

(1) Description Based on the previous one, we use lxml to extract the body content of blog garden essay and save it in Word document. The following modules are used to operate Word documents: pip install python-docx Modified code (mainly added the following paragraph in the while loop of link_crawler()) 1 tree = lxml.html.fromstring(h ...

Posted by phpDVWeaver on Tue, 31 Mar 2020 01:56:38 -0700