Copy Code code as follows:
#-*-Coding:utf-8-*-
Class Heap (object):
@classmethoddef parent (CLS, i):"" "Parent node Subscript" "return int ((i-1) >> 1);
@classmethodDef left (CLS, i):"" "" "The Left son subscript" "Return (I
RPC is the abbreviation of remote Procedure call, translated into Chinese is a long-distance method invocation, is a local machine on the remote machine to invoke a process (method) of technology, this process is also known as "distributed Computing"
RESTful architecture, is currently a more popular kind of Internet software architecture. REST, the abbreviation for representational state transfer.
The white point is the website is the software, and then the DOT is a service software to support
The test configuration file test.conf The following contents:
Copy Code code as follows:
[A]
W = 2
V:3
C =11-3
[Second]
Sw=4Test:hello
The test configuration file has two areas, first and second, and
Python can return multiple values, which is really handyReturns in a function can only return a value, but the return type is not restrictedTherefore, we can "return a tuple type to indirectly return multiple values".Example is my example when I
The Python sys module contains functions related to the Python interpreter and its environment, which you can use DIR (SYS) to view the methods and member properties inside him
Copy Code code as follows:
Import Sys
Print dir (SYS)
After installing the Paramiko, look at the following example:
Copy Code code as follows:
Import Paramiko
#设置ssh连接的远程主机地址和端口T=paramiko. Transport ((Ip,port))#设置登录名和密码T.connect
Copy Code code as follows:
# Compare two strings if the difference returns the first different position
# if the same return 0
def cmpstr (str1, str2):
Col = 0
For C1, C2 in Zip (str1, str2):
if C1 = = C2:
Col + 1
Continue
else:
Break
In Python, the Pickle class can generally be used to serialize Python objects, while Cpickle provides a faster and simpler interface, as the python document says: "Cpickle-A faster pickle".
Cpickle can serialize any type of Python object, such as
Copy Code code as follows:
Import OS # # for Os.path.isfile ()
def dealline (line):Print (line) # # for line I can do a lot of things
Def getfilename ():return input, ' please input file name (input exit () for exit): '. Strip ()
Class
When dealing with polymorphic objects, you only need to focus on its interface, Python does not need to display the written (like Java) interface, in the use of objects to assume the use of the interface, if not actually included, in the run error.
Copy Code code as follows:
#!/usr/bin/python
# Encoding=utf-8
# Filename:send_email.py
From Email.mime.image import Mimeimage
From Email.mime.multipart import Mimemultipart
From Email.mime.text import Mimetext
Import Smtplib
Class
Today, while looking at other colleagues ' code, I found an unused python keyword: yield
First asked a colleague, listening to him say a few words, there is a vague impression, just vague. So I went to search the data to see. Read for a long time,
Need to first install pywin32,windows down with WINAPI interface
Copy Code code as follows:
#
# _*_ Coding:utf-8 _*_
__author__ = ' shanl '
Import Win32APIImport Win32conImport Win32guiFrom ctypes Import *Import time
Vk_code = {'
Call different validation functions to check the input according to the different configuration files. You can change the logic of the validation function based on your requirements.
Copy Code code as follows:
def verifydata (func):
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