12 lines
306 B
Python
12 lines
306 B
Python
import base64
|
||
|
||
username = "zhc2"
|
||
password = "123456"
|
||
|
||
# 将用户名和密码组合,并进行base64编码
|
||
credentials = f"{username}:{password}"
|
||
credentials_bytes = credentials.encode('ascii')
|
||
base64_credentials = base64.b64encode(credentials_bytes).decode('ascii')
|
||
|
||
print(f"Basic {base64_credentials}")
|