import sqlite3
sql = sqlite3.connect('sb.db')
cur = sql.cursor()

# Takes 1 mil+ subs from sb.db file and puts them into subs.txt
# download for sb.db: https://github.com/voussoir/reddit/release

# 'SELECT last_seen FROM popular'
# 'SELECT idstr FROM popular'
# 'SELECT name FROM subreddits'

cur.execute('SELECT name FROM subreddits')

names = [x[0] for x in cur.fetchall()]

with open('subs.txt', 'w') as handle:
    for name in names:
        if '\n' in str(name):
            name.replace('\n', '')
        handle.write(str(name) + '\n')

b990dbb455da339be1d5c2f34b0b76f5dda9b264
<mask token>

<mask token>
cur.execute('SELECT name FROM subreddits')
<mask token>
with open('subs.txt', 'w') as handle:
    for name in names:
        if '\n' in str(name):
            name.replace('\n', '')
        handle.write(str(name) + '\n')

<mask token>
sql = sqlite3.connect('sb.db')
cur = sql.cursor()
cur.execute('SELECT name FROM subreddits')
names = [x[0] for x in cur.fetchall()]
with open('subs.txt', 'w') as handle:
    for name in names:
        if '\n' in str(name):
            name.replace('\n', '')
        handle.write(str(name) + '\n')

import sqlite3
sql = sqlite3.connect('sb.db')
cur = sql.cursor()
cur.execute('SELECT name FROM subreddits')
names = [x[0] for x in cur.fetchall()]
with open('subs.txt', 'w') as handle:
    for name in names:
        if '\n' in str(name):
            name.replace('\n', '')
        handle.write(str(name) + '\n')

import sqlite3
sql = sqlite3.connect('sb.db')
cur = sql.cursor()

# Takes 1 mil+ subs from sb.db file and puts them into subs.txt
# download for sb.db: https://github.com/voussoir/reddit/release

# 'SELECT last_seen FROM popular'
# 'SELECT idstr FROM popular'
# 'SELECT name FROM subreddits'

cur.execute('SELECT name FROM subreddits')

names = [x[0] for x in cur.fetchall()]

with open('subs.txt', 'w') as handle:
    for name in names:
        if '\n' in str(name):
            name.replace('\n', '')
        handle.write(str(name) + '\n')
