-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
30 lines (21 loc) · 1004 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
myString = "GET /hello HTTP/1.1"
A = "class http_response :def __init__(self, response):self.response = response.split(' ')self.type = self.response[0]self.path = self.response[1]self.http_version = self.response[2]"
B = "class http_response :def __init__(self, response):self.response = response.split(' ')self.type = self.response[0]self.path = self.response[1]self.http_version = self.response[2]"
print(A==B)
#---------------------------------------------------------
class http_response :
def __init__(self, response):
self.response = response.split(' ')
self.type = self.response[0]
self.path = self.response[1]
self.http_version = self.response[2]
hello = http_response(myString)
print(hello.http_version)
class HTTP_Response :
def __init__(self, response):
self.response = response.split(' ')
self.type = self.response[0]
self.path = self.response[1]
self.http_version = self.response[2]
x = HTTP_Response(myString)
print(str(x.http_version))