DAY3 haproxy configuration file modification

Source: Internet
Author: User
Tags haproxy

Collection:

1list1=[1,3,4,6,7]2 #List Conversion Collection3list1=Set (List1)4 Print(List1)5 #Defining Collections6List2=set ([3,7,5,8])7 Print(Type (LIST2))8 #intersection9 Print(List1.intersection (list2))Ten Print(List1 &list2) One #and set A Print(List1.union (list2)) - Print(List1 |list2) - #Difference Set the Print(List1.difference (LIST2))#List1, there's list2. - Print(List2.difference (List1))#Liat2, there's List1. - Print(List1-list2) - #Symmetric difference Sets + Print(List1.symmetric_difference (list2)) - Print(list1 ^list2) + #judging subsets A Print(List1.issubset (list2)) at #judging the parent set - Print(List1.issuperset (list2)) - #determines if there is an intersection, and does not return true -List3=set ([2,5]) - Print(List1.isdisjoint (LIST3)) - #add an item to the collection inList1.add (123) - Print(List1) to #add multiple items in the collection +List1.update ([2,5]) - Print(List1) the #use Remove to specify that an item is deleted * #Pop Random Delete $ #Discard Delete no return value

File:

1 #Read Content2F=open ("Yesterday2","R", encoding="Utf-8") 3 #Write Content4F=open ("Yesterday2","a", encoding="Utf-8") 5 #Write Content6F=open ("Yesterday2","W", encoding="Utf-8")7 #back to where the file started.8 F.seek ()9 #locationTenF.tell ()

File modification:

1F=open ('A1','R', encoding="Utf-8")2F_new=open ('A2','W', encoding="Utf-8")3  forLineinchF:4     if "Nihaotopaz" inchLine :5Line2=line.replace ('Nihaotopaz','nihao!!! ')6F_new.write (line2)

Haproxy File Modification Exercises:

DAY3 haproxy configuration file modification

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.