首页 > 解决方案 > Python ''PRAW'' api 库崩溃脚本

问题描述

我一直在研究一个 python 脚本,旨在帮助使用“警告”来调节 subreddi。但是,我无法让它工作,因为当我到达脚本中它应该使用 api 的位置时,python 窗口就会关闭。我尝试过使用更简单的脚本,但它们都不起作用。这是我更简单的文件(我用它来测试):

import prawcore
import praw
from os.path import isfile
import praw
import pandas as pd
from time import sleep
# Get credentials from DEFAULT instance in praw.ini
reddit = praw.Reddit()
# begining of script
#login
reddit = praw.Reddit(client_id='this is where i put my user agent',
                     client_secret='this is where i put my secret',
                     password='this is wher i put my password',
                     user_agent='PARS (Python-based Advanced Reddit Reprimand System) by u/veryinterestingnut',
                     username='PicoModBot')
print(reddit.user.me())

这是我的 praw.ini 文件:

# The URL prefix for regular requests.
reddit_url=https://www.reddit.com

# The URL prefix for short URLs.
short_url=https://redd.it

[DEFAULT]
client_id=my id was here
client_secret=this is where i put my pass
user_agent=PARS (Python-based Advanced Reddit Reprimand System) by u/veryinterestingnut
username=PicoModBot
password=my account pass was here

我能做些什么来尝试解决这个问题?任何帮助将非常感激。

标签: pythonapipraw

解决方案


推荐阅读