Reddit script to delete all comments and submissions.

Sweet little script, good job! Made a concise edit that uses Thread from threading (rather than Process from multiprocessing) and edits comments and text submissions (i.e. self posts) to "." before deleting them, for extra security (as deleting comments without editing them doesn't technically delete them, just makes them not show).

``` import praw from threading import Thread

Edit your app details

user_agent = 'bot_name' client_id = '14_char_key' client_secret = '27_char_key'

Edit your login details

username = 'your_username' password = 'your_password'

If you don't want to delete comments/posts, alter to False respectively

delete_comments = True delete_posts = True

Edit to how many recent comments/posts you want to delete, if you want to limit this

e.g. comment_limit = 10 will result in your 10 most recent comments being deleted

comment_limit = None post_limit = None

Don't edit below!

reddit = praw.Reddit( user_agent=user_agent, client_id=client_id, client_secret=client_secret, username=username, password=password)

redditor = reddit.redditor(username)

def del_comments(): for comment in redditor.comments.new(limit=comment_limit): comment.edit(".") comment.delete()

def del_posts(): for submission in redditor.submissions.new(limit=post_limit): if(submission.is_self): submission.edit(".") submission.delete()

if(delete_comments): Thread(target=del_comments).start() if(delete_posts): Thread(target=del_posts).start() ```

/r/learnpython Thread