Exceptions and Errors1. Syntax error (this error, the syntax of the Python interpreter can not be detected, must be corrected before the program executes)# syntax error demonstration one if # syntax error demonstration two def Test: Pass #
Old Boys Training and study:1 " "2 AUTHOR:RANXF3 " "4menu = {5 'Beijing': {6 'Haidian': {7 'Five crossing': {8 'Soho': {},9 'NetEase': {},Ten 'Google': {} One }, A
When writing a test script, there are often some data that needs to be changed, which can be placed separately in the INI file and then read and passed toCorresponding functions, so that the program operates more flexibly. The specific methods are
f = open (' xx ', ' A + ', encoding= ' utf-8 ')#文件打开有3种方式R r+W w+A +# Read R #如果打开的文件的时候没有指定模式, then default is read# Read and write mode r+, as long as the R, the file does not exist, open will error# Write W w mode will empty the original file
A collection of Python learning Notes (vii) 2Immutable CollectionSet the set () in the Python Learning Note (vi) Collection 1, which creates collections that can be modified in-place, or mutable, that is, unhashable.There is also a collection that
When writing code, you will always encounter a variety of time processing and requirements. To summarize:First of all, this article is a summary of the DateTime module.Begin.First, DateTime basic operation1. Get the current datetime1 times =
Jupyter descriptionJupyter Notebook is a web-version of the Python editor component for easy learning of Python
Jupyer InstallationYum-y Install Python-pipPython3:python3-m pip Install--upgrade pippython3-m pip Install JupyterPython2:python-m
The Python dictionary belongs to a data type, and we can store the data in a dictionary, which is defined using curly braces "{}".For example, now to store a person's information and then read it, you can use a slice of the way to reflect:In [1]:
Two functions of a collection1. The set can realize the function of de-weight;2. The set can implement relationship testing: intersection, Difference set, and set, whether subset, whether there is no intersectionTo elicit a collection with a single
is the smallest unit in the computer currently allocating resources to the application;Process, which is the smallest unit running the application in the current computer;In the actual system, in fact, the process is divided into processes to
Data type: Int/str/bool/list/dict/tuple/float/set (set type natural deduplication)I. Definition of a collections = set () #定义空集合s = {' A ', ' B ', ' C ', ' d '} #集合不是key-value-shaped, no colonThe set is unordered and cannot be evaluated by subscript.
A collection of Python learning Notes (vi) 1The various types and methods in Python can be found using the following method:(1) using Dir () or help () in interactive mode(2) GoogleCollectionFeatures: English set, some variable, some immutable; the
Date and time, date and time# In code, we often need to deal with time. In Python, time processing-related modules include time, datetime, and calendar. # in Python, time is usually expressed using timestamps, formatted time strings, and metadata 3.
Wtforms quick use and source code analysis (based on flask), wtformsflaskWtforms
Similar to the form component of django, the following is an example of an application for quick query.Start to use
1 from flask import Flask, render_template, request,
Python practice === use python to recognize Chinese Characters in Images,
Modules to be installed
PILpytesseract
Tools to be downloaded:
Http://download.csdn.net/download/bo_mask/10196285
Download and unzip the package and install itDefaultPath,
Add, delete, modify, and query the Python list1. add, delete, modify, and query a list Add elements to the list:1. Add an element from the end of the list: append ("") 2. insert an element from the list: insert (subscript position, inserted element)
Python development [2] basics and python DevelopmentInitial recognition of Variables
Variable is a new knowledge point and a concept that needs to be well known when learning Python. Python is a dynamic type language. It can be bound to a value of
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