Find a Web page, such as https://www.python.org/events/python-events/, to view the source code in a browser and copy it, then try to parse the HTML and output the time, name, and location of the meeting published on the Python website.1
The methods of the class are divided into: Common method and static method two kindsFirst, the common method:Call execution by object (method belongs to Class)1. Create a methodclass Province: " China " def __init__ (self,name): =
A folder below a lot of picture format is JPG size is 1920*1080, processing them into 1280*720 and save the original picture name in another pathHere first to find all the picture files under the given path, and then modify the size of the picture
Python programming consists of three stages:
Process-oriented programming: From top to bottom based on business logic
Functional Programming: Function encapsulation of a function, the use of the function can be called, reduce the amount
1. Create a folderImport os>>> os.mkdir ("D:\python\dir")2. Determine the file or folderImport OS#判断是否是文件夹>>> os.path.isdir (R"D:\python\dir") True#判断是否是文件>>> os.path.isfile (R"D:\python\dir\file.txt") True 3. Traverse all files under the
Reference: http://pip.readthedocs.io/en/latest/user_guide/#config-filePyPI in the domestic watercress source address is as follows:http://pypi.douban.com/simple/Note that there are/simple directories to follow.Use a specific image source
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
1. Configparser Module ImportConfigparserconfig= Configparser. Configparser ()#Apply config First configparser, personal feeling a bit like logger in the logging moduleConfig.read ('DB', encoding='Utf-8')#read the configuration file, the encoding
In many of the Python source files, there is a statement like this:if __name__ ' __main__ ' : # Script code hereFor example, there are two source files a.py and b.py, all have the above code: import A.py:import A in b.pyExecute the If __name__ =
the implementation here refers to the Python interpreter and the standard library, which are in line with the Python language specification. These implementations, while implementing the same language, are somewhat different from each other,
Compression Decompression Package#Import ModuleImportZipFile#Create a new compressed package and compress the DB and ooo.xml into a filez = zipfile. ZipFile ('Laxi.zip','W') Z.write ('DB') Z.write ('Ooo.xml') Z.close ()#Unzip to open the Laxi.zip
The implementation method of calling functions based on strings in python.
In python, functions can be called Based on strings:
1. Use getattr to call a function from a string
In a multi-process, a string may be passed over. How can I call an
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
Python basics ------ advanced ------ algorithm series, python ------
Introduction
I have long wanted to develop a series of Python, but I am too lazy to execute it until now. Recently, I feel that I have no face to face and have no face to face. I
Personal Python commonly used Package and its installation, pythonpackage
In order to avoid turning to the west each time you reinstall the system, record the commonly used Python package installation process.
1) Python: 2.7.11, www.python.org.
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