I use Python to operate the MySQL database, the data format of the database is UTF8, I use Python to invoke the SELECT statement after the database to obtain information, and then print out the use of printing, the original Chinese data can not be
Find the body of the Web page through the Get_text method of the BeautifulSoup library:#!/usr/bin/env python#coding=utf-8#html Find body import requestsfrom bs4 import beautifulsoupurl= ' http://www.baidu.com ' Html=requests.get (URL)
To was or is question!! Life is not just a question of choice, but also a judgment question.-----------HashlinuxConditional judgmentComputers can do a lot of automated tasks, because it can make their own conditions to judge.For example, enter the
One, module supplementConfigparser1. Basic Read configuration file
-read (filename) reads INI file contents directly
-sections () gets all the sections and returns as a list
-options (section) gets all the option of the section
-
DataThe data structure is simple to understand that it is a structure that can handle some data, or that it is used to store a set of related data.There are three types of built-in data structures in Python: Lists, tuples, and dictionaries.List:
In order to avoid the re-installation of the system and East-west to find, now this record of the current common Python package install process.1) python:2.7.11,: www.python.org. Because the individual likes to use the PYQT4 (actually does not PyQt5
1. Install python,:http://python.org---installation version 3.5.1PS: Comes with Setuptools and PIP tools2. Then, pip install the third-party libraries needed to develop the Web App: Asynchronous framework Aiohttp:$pip install aiohttp3. front-end
Module One, Configparser== V31. Get all nodesImport= configparser. Configparser () config.read ('settings', encoding='utf-8' = Config.sections ()print (res) 2. Gets all the key-value pairs under the specified nodeImport= configparser. Configparser ()
Refer to Object-oriented, always inseparable from a number of important terms: polymorphism (polymorphism), Inheritance (inheritance) and encapsulation (encapsulation) Defining a class can be defined in the following way: class ClassName: #
Although Python is an explanatory language, it is object-oriented and can be programmed with objects. Here's a look at how to program object programming in Python.I. How to define a classBefore you go into Python-oriented programming, learn several
Three days do not practice layman, the most important thing is to insist!Wu Sir's blog is very clear, the key is that the class is very good, once again understand, the original address: http://www.cnblogs.com/wupeiqi/p/4493506.htmlProcess oriented:
Article excerpt from: http://www.jb51.net/article/58009.htmFirst, such as in Vim under the implementation of the code completion function.To enable automatic completion for vim, download the pluginCd/usr/local/srcwget
PyCharm Tutorial: Build a Python development environment, pycharmpython
PyCharm is a member of the JetBrains series and is now the best IDE. PyCharm maintains JetBrains's highly intelligent style. The following is a brief example:
Unique local
Function Analysis of the _ init _. py file in the Python module package,
This example describes the _ init _. py file function in the Python module package. We will share this with you for your reference. The details are as follows:
It has been
Python uses the dis module to decompile Python into bytecode for detailed usage, dispython
Dis-Disassembler for Python bytecode, that is, decompiling python code into bytecode instructions.Easy to use:
python -m dis xxx.py
Python code is first
Use python3.5 to copy Microsoft notepad and python3.5notepad.
The examples in this article share the specific code of python3.5 imitation Microsoft notepad for your reference. The specific content is as follows:
From tkinter import filedialogimport
A summary of the writing style of multi-line annotation documents in Python,
What is docstring
In software engineering, coding is very small, most of which are other things, such as writing documents. Documentation is a tool for communication.In
Examples: class inheritance in Python Object-Oriented Programming and python Object-Oriented Programming
To create a class in python, you only need to define it.
class Cat: pass
Just like this. By creating a subclass, We can inherit its parent
Ppthon basic learning: Dict and ppthon basic dict
1. What is a dictionary?
A dictionary is the only ing type in Python.
In a ing object, the hash value (key, key) has a one-to-many relationship with the object (value, value), which is generally
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