[英]I dont know why I get a 400 bad request error for sending a discord webhook. Everything seems fine but I am new at this
[英]I am trying to get the API from another module everything is corrects i dont know why i am getting this error?
# import the requests library
import requests
# import the API key
from config import weather_api_key
Traceback (most recent call last):
File "/Users/siddhantarora/opt/anaconda3/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3437, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-7-2ca4475f6397>", line 5, in <module>
from config import weather_api_key
File "/Users/siddhantarora/Desktop/BOOTCAMP/World_Weather_Analysis/config.py", line 1
weather_api_key = 5cdc2fee9307ead10a4b44367c7aec48
^
SyntaxError: invalid syntax
在文件/Users/siddhantarora/Desktop/BOOTCAMP/World_Weather_Analysis/config.py
中,您必須將weather_api_key = 5cdc2fee9307ead10a4b44367c7aec48
更改為weather_api_key = "5cdc2fee9307ead10a4b44367c7aec48"
並帶有引號。
如果這是真的,您還應該更改您的 api 密鑰,因為任何人都可以竊取它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.