I am an operations engineer, in the operation and maintenance industry is very confused, feel the operation of the relative is a very unclear responsibility of the job, until I understand the language of Python.In the occasional opportunity to see
I am Qiang Zhang, I signed up in August 2016 to participate in the Python network training course by teacher Alex, hoping to achieve the goal of the network engineer to be a behavioral DevOps engineer after learning.
Tag: Number lookup means using ETH data phone pre res#a simple database#The dictionary uses the name of the person as the key. Each person is represented by another dictionary whose key ' phone ' and ' addr ' represent their phone number and address
1 #Author:ersa2 " "3 Program: Shopping Cart Program4 5 Requirements:6 7 After you start the program, let the user enter the payroll, and then print the list of items8 allow users to purchase items based on their product number9 after the user
1 #Coding:utf82 Importdatetime3 defTime_differ (date1='12:55:05', date2='13:15:05'):4 " "5 @ incoming is a time format like ' 12:55:05 '6 " "7Date1=datetime.datetime.strptime (Date1,"%h:%m:%s")8Date2=datetime.datetime.strptime (Date2,"%h:%m:%
Reads the contents of the file Cdays?4-test.txt, removes empty lines and comment lines, sorts them in the behavior unit, and outputs the results as cdays?4-result.txt.
Cdays?4-test.txt's Content#some Wordssometimes in life,you find a special
I. Input/encryption#!/usr/bin/python#coding: Utf-8Import GetpassName = Raw_input (' Please enter user name: ')PWD = Getpass.getpass (' Please enter password: ')If name = = "Alex" and pwd = = "cmd":Print "Welcome, alex! "ElsePrint "User name and
Tag: Lock file read-only operation Python path exists open files lineI. Read and write files
1. Locate the file
File path:./test.py
2. Open File
Open (' File path ', ' mode ')
Mode:
R, open in read-only mode
W, open
Singleton mode just start to understand when I and my small partners are two face, and later also after a series of inquiries, and so on, agreed that this to engage in a.Overview of the Singleton mode: theSingleton mode requires that a class have
Nose_parameterized enables parameterization of UnitTest supportGIT https://github.com/wolever/nose-parameterized
@parameterized.expandand can be used to generate test methods in situations where test generators cannot is used (for example,
Create a simple model
Class person (models. Model):Gender_choices= ((1, ' Male '),(2, ' Female '),)Name=models. Charfield (max_length=30,unique=true,verbose_name= ' name ')Birthday=models. Datefield (Blank=true,null=true)Gender=models. Integerfield
In situ mutable types and immutable types
The In-place immutable type is also called a hash (hashable) type, where a mutable type is also called a non-hash type.
Immutable types in situ:
Numeric type: int, float, decimal. Decimal, fractions.
A few days ago look at the Python programming language of Django, as the expert scholar said, want to be a successful developer, the first thing is to master another language, so I chose the Python programming language to start.
From these days of
This module has only a few functions,
Once you decide to use a binary search, you immediately think of using this module
Import bisect L = [1,3,3,6,8,12,15] x = 3 x_insert_point = Bisect.bisect_left (l,x) #在L中查找x, X is present and returns
Example 1
We are going to request five different URLs:
Single Thread
Import time Import urllib2 defget_responses (): urls=[ ' http://www.baidu.com ', '/HTTP// www.amazon.com ', ' http://www.ebay.com ', ' http://www.alibaba.com '
Today's Learning Record:While Loop.For Loop.While basic syntax:Count = 0While true:print (count, "-----") count +=1 if Count =For basic syntax:For I in range (0, 2): print (i, '-----') for G in range (g) if g > 5:breakSample Guessing
Python implements a small tool for color value conversion, python
Requirements
The company's UI design elder brother has been switching to Zeplin for a long time. The Zeplin design draft displays the color values of the page in decimal RGB format.
Python Regular Expressions (beginner), python Regular Expressions
Introduction
First, what is a regular expression?
Regular Expression, also known as Regular Expression, rule Expression, Regular Expression (English: Regular Expression, often
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