Python Reddit API PRAW:ConnectionRefusedError
Python Reddit API PRAW: ConnectionRefusedError
我正在使用 Reddit python 制作一个机器人 API 以下是我的代码,为了安全起见,应用程序密码和 ID 正在被替换,但它们是正确的。
import praw
reddit = praw.Reddit(
client_id="id",
client_secret="secret",
username='username',
password='password',
user_agent="python:com.example.myredditapp:v1.2.3 (by u/MattCodes2003)",
)
subreddit = reddit.subreddit('python')
hot_python = subreddit.hot(limit=5)
for submission in hot_python:
print(submission)
但是当我 运行 代码时,我得到以下错误:
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
我对这个错误感到很困惑,因为我严格遵循的教程和文档没有抛出这个错误,任何帮助都会很棒!
问题是我的身份验证错误,没有输入正确的密码。
我正在使用 Reddit python 制作一个机器人 API 以下是我的代码,为了安全起见,应用程序密码和 ID 正在被替换,但它们是正确的。
import praw
reddit = praw.Reddit(
client_id="id",
client_secret="secret",
username='username',
password='password',
user_agent="python:com.example.myredditapp:v1.2.3 (by u/MattCodes2003)",
)
subreddit = reddit.subreddit('python')
hot_python = subreddit.hot(limit=5)
for submission in hot_python:
print(submission)
但是当我 运行 代码时,我得到以下错误:
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
我对这个错误感到很困惑,因为我严格遵循的教程和文档没有抛出这个错误,任何帮助都会很棒!
问题是我的身份验证错误,没有输入正确的密码。