Automated Day2---python basics

Source: Internet
Author: User

Before writing Python, add the jmter pressure test to add the load machine:

1. First need to start jmter-server, the service in the JMeter bin directory

2. Next need to change the jmeter.properties configuration file, change the file is also in the JMeter Bin directory, and then open with Notepad, search remote host, add the other IP

3. Finally restart the Jmter, remote boot can

Python Basics:

Python is an interpreted language

Python can be used for data mining (crawlers), data analysis, automated operations, automated testing, backend service interfaces, AI, AI, embedded, web development

First, the basic operator

equals: = =

Not equal to:! =

Greater than: >

Less than:<

Greater than or equal to: >=

Less than equals: <=

second, define variables:name = ' YBQ ' #定义变量 strings quoted are best seen when they are definedname = ' Little black ' #定义成中文也可以, better not, too lowname = "Let's Go" #字符串里有单引号了就用双引号 with double quotes and single quotestxz = ' let ' go, ' haha ' #字符串里有单引号和双引号, use 3 quotation marks (3 single quotes)"is also a multiline commentthird, input inputs use:name = input (' Please enter your name ')print (' Your name is ', name ')Python3 Default Character set is unicode,2 default is ASCII, use 2 words need to precede with #coding=utf-8

Four, character formatting output:

Username = input (' name: ')Time =' 2011 'Print (username+' welcom ') # (two strings via + stitching) Print'%s,hwelcom '%username)Print'%s,hwelcom,s% '% (username,time)) #这么写效率高 S is string,d is an integer int,f is a decimal float Print' {},hwelcom,{} '. Format (username,time)) #这么写效率最高Print' {username},hwelcom,{time} '. Format (username=username,time=time))v. Circulation:For loop while loop whilethere must be a counter in the while loopcontinue end this cycle and proceed to the next cycleBreak Direct End Loop

Count =0

While count <:print (' good haha ')count = Count +1#count +=1 BreakElse: #正常循环结束后执行elseprint (' Done ') #正常循环结束后输出的For LoopFor I in range (Ten): Print' OK ', i)

Automated Day2---python basics

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.