1. User input#!/usr/bin/env python#_*_coding:utf-8_*_#name = Raw_input ("What's your Name?") #only on Python 2.xname = input ("What is Y Our name? ") Print ("Hello" + name)2, enter the password, if you want to be invisible, you need to use the
Article Source: http://www.cnblogs.com/Skyyj/p/6618739.htmlThis code is based on the Python 2.7If it is for Python3. X you need to change tkinter to Tkinter to change Tkmessagebox to MessageBox#-*-coding:utf-8-*-
Piecemeal accumulation IIIThe default value of a function's parameter is determined and saved in memory when the function is defined, and the function is called without a new space in memory and then re-assigned with the default value of the
Bubble Sort:Li = [33, 55, 58, 66, 58, 555,20000000000000000000000, 5555,5555, 5, 6, 62,1]For I in range (1,len (LI)): For L in range (Len (LI)-i): If LI[L] >li[l+1]: Temp =li[l] LI[L]=LI[L+1] li[l+1]=
Python high-order functionsFilter () For filtering sequencesThe first parameter receives a function that determines whether to persist based on the return value, true to leave, and false to discarddef is_odd (n): return n%2 = = 1filter (is_odd,
Python's web framework has a variety of Django, Tornado, Flask and more, and Django has its advantages over other web frameworks: Chatty, the framework itself integrates ORM, model binding, template engine, caching, session and many more.Basic
A concise explanation of the use of sys.argv[] in PythonBecause it is reading self-taught python, began soon after the introduction of the module function, and has been on the idle edit after the run, trying to find its use from the results, but the
Write a recent learning point of Knowledge 1. File read/write open a file: F=open (' path ', ' R ', encoding= ' utf-8 ') file to read ' R ' opens, can read the contents of the file, but cannot write F=open (' Path ', ' W ', encoding= '
I. Introduction of WebSockets
With the development of the Internet, the traditional HTTP protocol has been difficult to meet the increasingly complex needs of web applications. In recent years, with the birth of HTML5, the WebSocket protocol has
1, using RE. Debug to view the matching process of regular expressions
Regular expressions are a big feature of Python, but it can be painful to debug, and it's easy to get a bug. Fortunately, Python can print out a parse tree of regular expressions,
Step: Open File-"Action file-" close file
Open File
File handle = open (' File path ', ' mode ')
Specify file Encoding
File handle = open (' File path ', ' mode ', encoding= ' utf-8 ')
To prevent forgetting to close a file, you can use the
Python extracts the specified content based on a regular expressionRegular expressions are extremely powerful, and it is convenient to use regular expressions to extract the desired content.The following shows the use of regular expressions to
Common operations: Index, Shard, add, multiply, check whether an element belongs to a member of a sequence, length, minimum, maximum
Example:
NUMBERS=[100,34,67]Len (numbers) #返回值为3max (numbers) #返回值为100min (numbers) #返回值为34
List :
1. List function
Preface
The basics of regular expressions do not say, interested can click here, extract the general in two cases, one is to extract the text to extract a single position of the string, and the other is to extract a number of consecutive positions
I have been working in the operation of the industry for nearly 10 years, I first contact Linux is in a sophomore appearance, then only the pursuit of easy to understand, so the choice of Ubuntu as a learning, use of the object, it is simple, easy,
Usage of and and or in PythonFrom "dive into python"python in the and the expression is evaluated from left to right, and if all values are true, the last value is returned, and if there is a false, the first false value is Returned. or also from
1, Ord (), Convert the character to its corresponding ASCII codeChr () converts the ASCII code to the corresponding character650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M00/8F/2D/wKiom1jWCurAUuBIAAAJq4areFQ487.png-wh_500x0-wm_ 3-wmp_4-s_2
000 Python Zen, 000 python
The Zen of Python, by Tim Peters
Beautiful is better than uugly.Explicit is better than implicit.Simple is better than complex.Complex is better than complicated.Flat is better than nested.Sparse is better than
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