forked from pcewebpython/socket-http-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_scratch.py
15 lines (11 loc) · 918 Bytes
/
_scratch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
PROTOCOLS_LIST = ['http/1.0', 'http/1.1', 'http/2.0']
path = '/a_web_page.html Host: 127.0.0.1:10000 Connection: keep-alive Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36 Edg/87.0.664.41 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Sec-Fetch-Site: none Sec-Fetch-Mode: navigate Sec-Fetch-User: ?1 Sec-Fetch-Dest: document Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q'.lower()
path_words = path.split(' ')
results = path_words[0]
print(results)
query = 'What is hello'
stopwords = ['what', 'who', 'is', 'a', 'at', 'is', 'he']
querywords = query.split()
resultwords = [word for word in querywords if word.lower() not in stopwords]
result = ' '.join(resultwords)
print(result)