This is mainly to learn how to do the input and output box, such as the production of password interface.Here is a simple input box for making:From tkinter Import *root = Tk () E = Entry (root) #输入框e. Pack (padx=20,pady=20) e.delete (0,end) #把窗口从0
Pyenv is a tool that facilitates the use of multiple versions of the Python environmentPyenv is written using shell script, only need to download to use, do not need root user, this I prefer.Specific introduction to see the website:
Simple processLoop output 3 operation options read, modify, deleteInput 1 2 3After you have entered the number and then execute the appropriate methodImport OSdef read (): Read WithOpen"Haproxy.txt","R",encoding="Utf-8")As R1:list1=
Requirements:
Enter User name password
Show welcome message after successful authentication
Three-time error after locking
This process and job requirements are slightly different when the user enters the same user name three
Subprocess PrefaceImport OSOs.system (' dir ') #输出命令结果到屏幕, returns the command execution status (0 for execution success, 0 for execution failure)Os.popen (' dir '). Read () #保存命令的执行结果并输出 (/n newline), no return status#commands only support Linux
1 #data is created by copying the NC files2 ImportOS, Shutil3 4 #traverse the root directory5Root_dir ="d:\\test_data\\disaster\\"6 #time to get the NC file7Time_source ='20161228080000'8 #time to generate the NC file9Time_new ='20181228080000'Ten
A collection is an unordered set of distinct elements[Note]: The maximum function of a set is to perform a de-RE operation on a sequencefirst, the classification of the collection in Python, collections are divided into two categories, variable set
One, variable1. A variable defined in a subroutine is called a local variable, and a variable defined at the beginning of the program is called a global variable.2. The global variable scope is the entire program, and the local variable scope is the
1. Compare range and Xrange differences>>> Range (10)[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]>>> xrange (10)Xrange (10)Xrange is created during iteration loops2.Yield generator:Remember the last action, and the next time you execute it, continueDef func1
"Python learning" 8. Exceptions
Raise Exception: throws the specified exception
Try/except: Catching exceptions
Except: The first parameter is the type of exception that needs to be caught, can be a tuple of multiple types, and the second
The function of tuple is introduced in 1. The two methods of tuple 1. Built-in methods for tuples
Add two tuples格式:x.__add__(y)等同于x+y例如:tu1 = (1,2,3,) print(tu1.__add__((2,3,4,))) >>> (1, 2, 3, 2, 3, 4)返回值:tuple#只能是两个元组相加,生成一个新元组
Determine
This article mainly introduces the SQLite3 basic operation method in the Python2.7 programming, involves the Python2.7 operation Sqlite3 Database's deletion and modification and the anti-injection and so on related skill, needs the friend can refer
This article mainly introduces the creation and use of Python implementation class, combined with the simple calculator function example to analyze the Python class definition and use method, the need for friends can refer to the following
This
Introduction to Web Debugging tools and development environment building
Python and Selenium development environment build:
First, download the Python software
After downloading, install, install, open idle (Python 3.6.2), such as:
If you enter
Python crawler xlml Parsing Library (comprehensive understanding), pythonxlml
1. Xpath
Xpath is a language used to search for information in XML. It can be used to traverse elements and attributes in XML documents. Both XQuery and xpoint are built
Register and log on to the Python system, and log on to the python system.
Forms are mainly responsible for data collection in webpages. A form has three basic components: Form tag, which includes the URL of the CGI program used to process form data
Solution to python pyqt5 installation failure: pythonpyqt5
Preface
Recently, I encountered a problem in my work. python pyqt5 prompts a failure during installation. However, I can only find a solution to this problem. I found that the same problem
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