-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
46 lines (39 loc) · 1.23 KB
/
test.py
File metadata and controls
46 lines (39 loc) · 1.23 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import re
test = "hello - aiwd"
test = re.sub("(?<=\s\-\s)(.*)", "", test)
test = test.replace(" - ", "")
print(test)
# print(test)
# print("---------")
# test = re.sub("(?<=[a-z])(?=['][A-Z0-9])", " ", test)
# test = re.sub("(?<=[a-z])(?=[A-Z0-9])", " ", test)
# print(test)
# print("---------")
# test = test.lower()
# print(test)
# print("---------")
# test = test.strip().replace("in'", "ing").replace("i'ma", "i am going to").replace("'em", "them").replace("'cause", "because").replace(",", "")
# print(test)
# print("---------")
# test = re.sub("\[(.*?)\]", " ", test)
# print(test)
# print("---------")
# test = re.sub("\((.*?)\)", " ", test)
# print(test)
# print("---------")
# test = test.strip()
# print(test)
# print("---------")
# def access_code():
# client_creds = f"{os.getenv('CLIENT_ID')}:{os.getenv('CLIENT_SECRET')}"
# client_creds_b64 = base64.b64encode(client_creds.encode())
# token_url = "https://accounts.spotify.com/api/token"
# method = "POST"
# token_data = {
# "grant_type": "client_credentials"
# }
# token_headers = {
# "Authorization": f"Basic {client_creds_b64.decode()}"
# }
# r = requests.post(token_url, data=token_data, headers=token_headers)
# print(r.json())