1. Operators and their usage
operator
name
Description
Example
+
Add
Two objects added
3 + 5 get 8. ' A ' + ' B ' gets ' ab '.
-
Reducing
Get negative numbers or one
Today we have a problem:When I execute the following code, I find that the file is only half written. That is, when the file size is too large, the following code does not guarantee that the file will be written correctly.FD = open ('test.txt','w')
The built-in function, the Python builtin function (build in function), does not need to refer to other packages, generally becomes BIF ABS () calculates the absolute value, ABS (-10), receives number, returns the maximum (iterative) of the sequence
First, what is DOM?What is called Dom,dom is the Document Object model, which is a set of API interfaces based on browser programming (in this tutorial, which can be said to be DHTML programming), the recommended standards for the Web, and each
Python basic Syntax (iii)--------------------------------------------the basic syntax of Python (ii)--------------------------------------------Vii. Object-Oriented programmingPython supports object-oriented programming, classes and objects are the
Python basic Syntax (ii)--------------------------------------------the basic syntax of Python (i)-------------------------------------------- 2. TuplesThe tuple and list are very similar, but the tuple is immutable, that is, the tuple cannot be
System: Windows 10Python version: 3.5.2The following errors occur: C:\USERS\ZHUXY>PIP List Fatal Error in launcher:unable to create process using ' "'Try the solution:c:\users\zhuxy>python-m pip Install packageCollecting PackageDownloading
Also refer to the online tutorial, write crawl post content, while the crawl of the post saved to the local document:#!/usr/bin/python#_ *_coding:utf-8_*_Import UrllibImport Urllib2Import reImport SysReload (SYS)Sys.setdefaultencoding
A regular expression is a special sequence of characters that can help you easily check whether a string matches a pattern. Python has added the RE module since version 1.5, which provides a Perl-style regular expression pattern.
The RE module
Example 1, get MySQL version
The code is as follows:
#-*-Coding:utf-8-*-#安装MYSQL DB for PythonImport MySQLdb as MDBcon = NoneTry#连接mysql的方法: Connect (' IP ', ' user ', ' password ', ' dbname ')con = mdb.connect (' localhost ', ' root ',' Root ', '
A python conditional statement determines the code block that executes by executing the result of one or more statements (true or false).
You can easily understand the execution of conditional statements by:
The Python program language specifies
Usually write python will often want to get the script in the directory, such as a file with the script file in a relative directory location, it can be found in the script file directory to the corresponding file, even if the script file moved to
Python batch Modify file names,
Recently I downloaded several American TV series (jailbreaking, lost, right game...). The file name of each episode is very long .. I want to shorten it, but I am too tired to change it one by one, so I wrote a script
The solution to reading and writing json Chinese ASCII garbled characters is to read and write jsonascii garbled characters.
Today, I want to help the front end write a small background, that is, read the data and convert it to json for him to
Python processes log File scripts in real time,This Python script is used to monitor the content of real-time files. For example, the Error or time out fields can be customized. It is my first real Python script and I feel bloated, but I plan to
Summary of exceptions in Python basics, and summary of python BasicsToday, we will explore most of the exception reports in python.
First of all, what is an exception? exception vernacular interpretation is abnormal. In a program, it generally means
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