Contacted Ruby and found it has a package management tool Rubygem is very useful and has a very complete documentation system Http://rdoc.infoDiscovery Python also has the same tools, including Easy_install and Pip. Just, I did not examine the
IntroducedPython's set is a set of unordered, non-repeating elements, with basic functionality including relationship testing and de-duplication elements. The collection objects also support and, intersection, difference, symmetry and so on.Sets
http://blog.csdn.net/pipisorry/article/details/45771045Python built-in functionsEnumeration function Enumerate
>>> List (Enumerate (' abc '))
[(0, ' a '), (1, ' B '), (2, ' C ')]
The enumerate function can also receive a second
1.abs () function >>> ABS ( -1) 1>>> abs (1+2J) 2.23606797749979 The ABS function usually returns the absolute value, while the plural uses ABS to return (A+BJ) A and B squared and then take the square root, as shown above 2.pow () and Math.pow ()
1, first to the official website http://pypi.python.org/pypi/setuptools download Setuptools.exe file and install2. It is recommended to add D:\Python27\Scripts to the PATH environment variable after installation, and then use the easy_install pip
1 #-*-coding:utf-8-*-2 #author:pete yim3 #date:13-8-224 #Copyright (c) rcsh Systems Incorporated. All rights reserved.5 ImportWin32print6 ImportWin32ui7 fromPILImportImage, Imagewin8 Import_imaging9 Ten # One #Constants for GetDeviceCaps A # - # - #
The use of configuration files in the program to flexibly configure some parameters is a very common thing, configuration file parsing is not complex, in Python more so, in the official release of the library contains the library to do this thing,
Objective: To format the data of several recording time, and then to sort.1. PrerequisitesThere are four files, the format of the file is different, both represent the timeJames.txt‘2-34‘‘3:21‘‘2.34‘‘2.45‘‘3.01‘‘2:01‘‘2:01‘‘3:10‘‘2-22‘Julie.txt‘2.59‘
def isphonenumber (text): #固定电话 If len (text)! =: return False # The number of bits is not enough for I in range (0, 4): if n OT Text[i].isdecimal (): return false # area code not if TEXT[4]! = '-':
Python nesting functionsThe nested function, as the name implies, is the function inside the nested function.
def A(a):
print "I am A"
def B(b):
print "a+b=",a+b
print "I am B"
B(2)
print "Over!
Win (python2.7):Execute this file1 #!/usr/bin/env python2 #Encoding:utf-83 4 #5 #script to register Python 2.0 or later for use with Win32all6 #and other extensions that require Python registry settings7 #8 #written by Joakim Loew for Secret Labs Ab/
Acm icpc Team, acmicpcteam
Link:
Https://www.hackerrank.com/challenges/acm-icpc-team/submissions/code/11617807
1 def count_max_topics (konw_topics): 2 max_topics = 0 3 max_teams = 0 4 for I, person1 in enumerate (konw_topics): # Learn How to Use
Python basic tutorial Reading Notes (2) Chapter 2 list and metadata, python basic tutorial
2.1 Sequence Overview
The main difference between a list and a group is that a list can be modified, but a list cannot be modified. That is to say, if you
Python Tips (occasionally updated), pythontipsDictionary sort
1. sort by key and forward
1 sorted (dic. items (), key = lambda d: d [0])
2. sort by value and Reverse Order
Sorted (dic. items (), key = lambda d: d [1], reverse = True)
3. After
Python traverses the database and obtains the key value.
Traverse the Redis database with keys stored in key-value mode in the format of PREFIX _ * and print their values.
SCAN is used for traversal, because keys prefix _ * may cause Redis to block
Use of the isalpha () method for processing strings in Python, pythonisalpha
The isalpha () method checks whether a string is composed of only letters.Syntax
The syntax of the islpha () method is as follows:
Str. isalpha ()
Parameters
NA
Python learning Data Structure instance code, python Data Structure instance
When learning python, it is used to practice code and review the data structure
#coding:utf-8#author:Elvis class Stack(object): def __init__(self, size=8): self.stack =
Python introduces MONGODB instances and pythonmongodb instances
This article describes how to use MONGODB in Python. Share it with you for your reference. The details are as follows:
1. Start mongodb
Mongod -- dbpath d: \ db
2. Start as a system
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