1. Module 1.1 Concepts
Each .py Python source code file that ends with an extension is a module;
The module name is also an identifier and requires a naming convention that conforms to the identifier;
The global variables, functions,
1 #-*-coding:utf-8-*-2 3 #function4 #the rules for defining functions in Python are as follows: Starting with Def, following the function name and (), passing in the arguments and variables in the middle of the parentheses, the function to:
Time ModuleTmie.strptime: Converting a time string to a time typeFormat: Time.strptime (string[string[, format])Results can be used to return the year using Time.tm_year and the remainder to be identical.# Example>>> t = time.strptime ("2018-2-2", "%
Simply put, Beautiful soup is a library of Python, and the main function is to fetch data from a Web page.Beautiful soup automatically converts the input document to Unicode encoding, and the output document is converted to UTF-8 encoding.Beautiful
One, under Windows Python installation : 1. Download the installation packagehttps://www.python.org/downloads/2. InstallationDefault installation path: C:\python33. Configure Environment variables"Right-click Computer"-"Properties"-"Advanced system
UnitTest a framework for unit testingWhat frame?A collection of a bunch of tools.TestCaseTestSuite test suite, multiple use cases togetherTestloader is used to load testcase into Testsuite.Testrunner is to execute the test case, the result of the
Introduction: CentOS is currently the most popular Linux server system, its default Python 2.x, but according to the Python community planning, in the near future, the entire community will migrate to Python3, and will not support Python2, how to
Recursive functions of PythonInside a function, you can call other functions. If a function calls itself internally, the function is a recursive function.For example, let's calculate factorial n! = 1 x 2 x 3 x ... x n , which is represented by a
Python List-generatedThe list generation, which is the comprehensions, is a very simple and powerful build of Python built-in that can be used to create lists.For example, to generate a list, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] you can use list(range(1,
#! /usr/bin/env python#-*-Coding:utf-8-*-# @Author: Yue Qian# @date: 2018-03-04"""Requirements: Enter user name, password, authentication successful display welcome information, enter the error three times after locking the user.Process:1. Determine
Python database programming,Outline
Basic Database Operations
Function Attributes & object Methods
Connect to database
Basic Database Operations
Create a database:
Create database test;
Grant all on test. * to user (s );
The first line creates a
Sesame HTTP: JavaScript encryption logic analysis and Python simulation to achieve data crawling, javascriptpython
This section describes how to analyze the JavaScript encryption logic and use Python to simulate the process of JavaScript data
Python crawlers get multi-page posts and python Crawlers
Today, I learned how to crawl multi-page posts, including
Soup. find_all and soup. selcet filter methods correspond to different parameters;
If you want to combine the obtained content
Python opencv histogram reverse projection method, pythonopencv
This article introduces the python opencv histogram reverse projection method, which is described as follows:
Objectives:
Histogram reverse projection
Principle:
Reverse projection can
Python3 crack the slider verification code function of geetest (excellent verification), python3geetest
The following code describes how to use python to crack the geetest verification code. The specific code is as follows:
From selenium import
Detailed explanation of the single-instance mode for implementing thread security in python, detailed explanation of the python thread
The Singleton mode is a common design mode. The main purpose of this mode is to ensure that a class only has one
Python variable,
Python variable: stores information and data for future use and modification.
1. python is case sensitive
2. variables can only consist of letters, numbers, and underscores. They cannot contain spaces, special characters, or
Concurrent chat on 035server and concurrent on 035server
1 import socketserver 2 3 class MyServer (socketserver. baseRequestHandler): 4 def handle (self): # The process of connecting each client to execute 5 print ('server start') 6 while True: 7
Python + Selenium notes (13): Page Object design mode, pythonselenium
(1)Preface
To put it simply, there are two layers: page class and test class.
Page class: divided into parent class and Child class (subclass refers to a specific page, each page
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service