Traversing Python syntax
2. Basic elements: numbers, strings, and variables
What are the basic types of 2.1 python?Boolean (True, False), Integer (42,100000), floating-point (3.14159,1.0e8), String ("string") All data in 2.2 Python is
In the python2.x version, different types of comparisons are supported, which are compared in the following principles:Built-in type:1. Same type: 1.1) Numeric type: Contains int, float, long, complex, BOOL (the bool type is a subclass of int, and
Import__ (name[, globals[, locals[, fromlist[, level]])The function that is called by the import statement. It exists primarily for you to change the semantics of an import statement with another function that has a compatible interface. Why and how
Python is one of the best programming languages and is widely used in scientific computing: computer vision, artificial intelligence, mathematics, astronomy, etc. It also applies to machine learning and is expected.Of course, it has some drawbacks,
The first thing we need to do is get MNIST data. If you're a git??, then you canBy cloning the Code repository for this book to get the data,Achieve our network to classify the numbersgit clone
There are two ways to format a Python string: a percent-semicolon, format-modeThe percent of the semicolon is relatively old, and format is a more advanced way to replace the old way, the two coexist.1, percent of the wayWhen formatting a string,
Second, basic useNosetest use of scripts (after nose is installed)or directories]We can use the configuration file to put the parameters that need to be run, the profile file name is Nose.cfg, is the standard profile format, as
Today, Python reads a configuration file with many fields, similar to the format in the configuration file:Pidstart:2600startfid:47starttid:450startfirst:1message: "It is common to think of:Config = open (Configpath, ' R ') for item in config://set
Introduction to Object OrientationObject-oriented requires two things: a class (a self argument must be in a class) and an objectC#,java are all just object-oriented programming, Python is function-oriented programming and object-oriented
Do the development of friends in writing code at the same time generally will write test code, which for the students to do operation and maintenance is seldom used.Today we will write the test code, using the UnitTest module.Cat test.pyImport
It is believed that most of the time we do not need to pay attention to the details of GetAttribute and getattr (at least myself:)),
In general, when consuming our custom classes, we understand the structure of the class and do not deliberately
Poplib module receiving mailPython's Poplib module is used to collect mail from POP3, or it is the first step in processing a message.
The POP3 protocol is not complicated, it is also used in a question-and-answer way, you send a command to the
operating system-related
System (): Operating system type (see example)
Version (): Operating system versions
Release (): Operating system release number, such as Win 7 returns 7, also like NT, 2.2.0 and so on.
Platform (Aliased=0, terse=0)
1. The role of multithreadingIn short, multithreading is the parallel processing of independent sub-tasks, which greatly improve the efficiency of the whole task.
2. Multithreading-related modules and methods in PythonSeveral modules are available
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