concurrent.future Module1 Thread Module /Thread Module1.1 Constants /ConstantsPass1.2 function /FunctionPass1.3 class /Class1.3.1 Threadpoolexecutor classclass Instantiation: Executor = threadpoolexecutor (Max_works)functions of the class : used to
#列表是什么?A list is made up of a number of elements that are ordered sequentially#在python中用 [] to represent a listFor example:Name_list = [] #这就是创建一个简单的列表#让我们在列表里面加入一些东西来做为后面列表操作的基础数据Name_list = [' Tom ', ' Jim ', ' Hanmeimei ']
#!usr/bin/env python#-*-Coding:utf-8-*-__author__ = "Samson"Import random,stringPrint (Random.random ()) # randomly generates a floating-point value between [0,1]Print (Random.randint (1, 6)) # randomly generates integers of the specified range [a,
StringIn each programming language there is the processing of strings, strings are essential for each programming language, and for strings we often combine, delete, transform, judge, and manipulate strings.
Formatting of stringsFormatting
2017 the last day, in the QC Inculcation, I finally wrote (back) six questions, the basic syntax of Python has a general understanding.1, A+b+cJust to practice the input, Line=input (). Split () into the list, split open to assign to A,b,c, don't
Fundamentals of Process and threading theory 1, Background knowledgeTheoretical basis:The role of an operating system: 1:隐藏丑陋复杂的硬件接口,提供良好的抽象接口 2:管理、调度进程,并且将多个进程对硬件的竞争变得有序Two multi-channel technology:
number: Common number types include integer (integer), long, floating-point (float), and complex (Complex)
Boolean (Boolean): True indicates True, False is false; (Python case sensitive)
Boolean values can be operated with and, or, and
graphvizPowerful and convenient diagram/flowchart drawing method, it is easy to remind us of machine learning in the Decision Tree way of presentation. Fortunately, the scikit-learn interface for generating the file is provided, with the .dot
str8="the difference between China and Korea"#a=str8.find ("Python")#Print aB=str8.find ("and the")PrintBword=str8.split (" ")#Python3 and Spark can split the Chinese directly right herePrintWord forIinchWord:#Python 2.x needs this output
The last is a small exercise, this time will be unittest modular, that is, the use case is placed in the case directory, start placed under the Bin directory-------------------Start------------------------------Import Unittest,htmltestrunner# 1x.
# This is an input statement Input (" Please enter your age:")# To Save the input as a variable = input (" Enter your name:"= input (" Enter your age:")age = Int (age)print(name,age)# This is a simple interactionPrint (Input (" This is also a
1, in python2.x raw_input () and input (), two functions are present, wherein the difference is
Raw_input ()---treats all inputs as strings, returning string types
Input ()-----can only receive input of "number", has its own
Proposition:
After you start the program, let the user enter the payroll, and then print the list of items
Allow users to purchase items based on their product number
After the user selects the product, checks whether the balance is
#file操作要点: Aaa.txt for DesktopsWith open (R ' C:\Users\xuyin\Desktop\aaa.txt ', ' R ') as F:X1=f.read () #得到一个字符串Print type (x1)Print (x1)F.seek (0,0)Print (1)X2=f.readline () #得到第一行, forming a stringPrint type (x2)Print (x2)# F.seek (0,0), no this
String manipulation Exercises:>>> ' no!\ ', Tom didn\ ' t want to join them. ' #使用斜杠来避免引号冲突 ' ' no! ', Tom didn ' t want to join them. >>> ' abc ' abcabcabc ' >>> words = ' let\ ' Make the world a better place! ' >>> Len (words) 36>>> words[35] '! '
Python+seleniumpython versionpython 2.Xpython 3.XWeb-based:web Page InstallationExecutable:exe InstallationRelated DocumentsIDLEPython's own editorPython shell modeShell mode similar to terminalManuals:python Official documentsSublime
Common Python data types: (1) Numeric type: is the number (integer, floating point) (2) sequence type that is normally processed: There are a series of objects that are side-by-side or arranged. such as String (str), list, tuple (tuple), etc. (3)
>>>time.time () # Returns the current timestamp1514623449.8858318>>>type (Time.time ())class 'float'>>>>>>> Time.sleep (2# thread postpones the specified time to run. Unit is seconds. >>> Type (Time.sleep (2))class 'Nonetype'>>>>>>>Time.clock () #
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