Python Basic Statements
First of all, this article for the author to learn "Python learning manual" notes, and to join the author's own understanding and summary.
1, Python statement features (1) The bracket () in the IF statement is optional.(2) A
For example, to crawl the problem I have done on the avionics, you can use the following code:
# ubuntu Kylin 14.04
import urllib2
import urllib
url= "http://acm.hdu.edu.cn/userstatus.php?user= 461807914 "
headers = {' user-agent ': ' mozilla/
Content from Opencv-python tutorials own translation finishing
TargetBlur the image using different Low-pass filtersFilter the image using a custom filter (two-dimensional convolution)
2D convolution (image filtering)The image can be low pass filter
Last night the platform was exploited by an individual user by a vulnerability:
Principle: https://www.zhihu.com/question/43621727
Http://blog.sina.com.cn/s/blog_593d2b950100hwl1.html
To execute the test code on the
1. Serialization Operation
1.1 Understanding the pros and cons of module Pickle/cpickle
Import Cpickle as pickle
my_data = {' name ': ' Python ', ' type ': ' Language '}
with open (' Pickle.dat ', ' WB ') as FP:
pickle.dump (MY_DATA,FP) ""
1. Direct non-root permissions install a Python
First, under the Software List folder
mkdir python-2.7
CD python-2.7
Download python-2.7.10 to current folder
CD python-2.7.10
[Plain] View plain
21, the Python list can be used in the Swap methodMylist[i], mylist[j] = Mylist[j], mylist[i]So we can swap two elements.And alsoA ^= bb ^= AA ^= b22. Python Rounding and keeping decimals
#encoding: utf-8
import math
#向上取整
print Math.ceil (2.6)
3.0
#
First, we can execute the following code to see what the search path for Python is:
Import Sys,pprint
pprint.pprint (Sys.path)
The pprint output is the Python search path, and the Python interpreter searches for the modules we need from
If passing friends find mistakes or opinions, please correct them and raise them. Of course, some of the problems have no clue, will refer to the predecessors of the code, thank you here.
5th Chapter 5-4
#!/usr/bin/env python
#coding:
http://blog.csdn.net/hushiwen/article/details/8531302
Specifically, the use of SetAttr, __setattr__, __dict__, and so on, you can see the Python manual, just write a small piece of code for example.
Class Foo:Passdef test (self):print "Hello"
Reproduced from: Original: Https://liangxiansen.github.io/2016/08/08/python process thread and coprocessor/author: Liang
Python Threads
The threading module in Python is used to provide threading-related operations, and threads are the smallest unit
a basic data type (INT,BOOL,STR)1. Basic data data type:int integerThe STR string. Generally do not store large amounts of dataBOOL Boolean value. Used to judge. True, FalseList of lists. For storing large amounts of data, [] indicates. It can be
1 #Coding:utf82 ImportCv23 4 """5 Change BGR at (0, 0) to white pixels6 7 No. 0, Green 1th, Blue 2nd, Red8 Each of the IMG locations has a 3-length vector representing the GBR9 """Ten #img = Cv2.imread (".. /data/mm2.jpeg ") One #print (img[0, 0]) #
Multi-tasking:Frok (): Can only be executed under LinuxImportOSImport Time#when the program runs, the ID of the parent process is already generated.Print('The current process is the parent process and the ID is:%s'%os.getpid ()) RET= Os.fork
Python Basics (i): Operators: Arithmetic operations:In addition to the basic +-*/, you need to know://To take the integer portion of the returned market quotient for example: 9//2---> 4, 9.0//2.0--->4.0% is the remainder of the division returned by
name of the variable01the. Identifier and keyword identifier identifiers are programmer-defined variable names, function names. Identifiers can consist of letters, underscores, and numbers. The keyword cannot begin with a number of keywords is the
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