One, configuration fileThe service side and the client's character encoding is different, may cause garbled display and so on, in order to unify the character encoding at both ends, can be implemented through the configuration file, of course, such
Read a little every week. Do not forget to beginner's mind party always! Continue Python second play.flag=" " flag2=" Queen "print(flag+ " \ n "+Flag2) #这里细心的小伙伴可能会发现. Flag has one more space before and after Flag2.
0. Dictionary initializationD = {' A ': 1, ' B ': 2}or d={}D[' a '] = 1D[' B '] = 2is not like JSON format data, syntax and JavaScript are very similar1. Variable Accept sequence decomposition:p = (3.14,8.23)X, y = PPrint (x, y)3.14,8.232.
Four lessons a week (October 19)1. Python Arithmetic operatorsAssuming that the value of the variable a is 10 , the b value of the variable is 21 , then-
operator
Description
Example
+
An addition
1. Data typeThere are four types of Python: integers, long integers, floating-point numbers, and complex numbers.
integers, such as 1
Long integers are relatively large integers.
Floating-point numbers such as 1.23, 3E-2
List is a combination that allows content to be duplicatedA tuple is a combination that allows content to be duplicatedDictSet is a combination that does not allow duplication of content, and the contents of the set are arbitrary, so they cannot be
DescribeThe range () function creates a set of continuously increasing integers that work like slices and are typically used in a for loop.GrammarRange (start, stop[, step])Parameter description:
Start: Count starts from start. The default
Python FIX: Nameerror:name ' reload ' is not defined problemFIX: Nameerror:name ' reload ' is not defined problemFor Python 2.X:Import sysreload (SYS) sys.setdefaultencoding ("Utf-8")For Import impimp.reload (SYS)Attention:1. Python 3 differs
Note content: Basic data TypesNote Date: 2017-10-20
Basic data types
In Python, variables do not need to declare data types, but each variable must be assigned before it is used, and only after the assignment is created. So in Python a
1, login program Practice1Readme = open ('Readme.txt,'W')2 3Readme.write (" "the code for the login system of the small demo, there are many imperfect places. 4 The main functions are as follows:5 Login successful, print welcome message, failure
A computer is a machine that can do mathematical calculations as the name implies, so a computer program can handle a variety of values. However, the computer can handle far more than the numerical value, but also can deal with text, graphics, audio,
RabbitMQMQ is all called the message queue, and Message Queuing (MQ) is an application-to-application communication method. Applications communicate by reading and writing messages to and from the queue (data for the application), without requiring
Message: Template language: Templates of the creation process, for the template, in fact, is to read the template (which nested template tags), and then the model obtained data into the template, and finally return the information to the user. The
The first python program and the first python Program
The next day after learning python, I finally edited the first program. The program requirements are as follows:
1. Enter the user name and password
2. The welcome information is displayed after
Python socket programming (1), pythonsocket
Socket is often called a Socket and has become a network programming standard that Windows, mac, and other operating systems comply. It can be used to implement communication between different computers
Python beginners Summary 3: files, collections, functions, variables, etc,
I. File Operations:
File Operation Process:
1. open the file, get the file handle, and assign it to a variable.
2. Operate the file through a handle
3. close the file
File
I learned python for about a week. I wrote a game that guessed numbers !, Python guess number
Print ("-------------------------------------------------------")Print ("-------------------------------------------------------")Print ("--------------
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