Uncategorized

Python Wordlist

[sourcecode language=”python” wraplines=”false” collapse=”false”]#!/usr/bin/env python3.6
import sqlite3
import sys
import random
conn = sqlite3.connect(‘list.db’)
c = conn.cursor()

l = [‘Ğ’,
‘Ç’,
‘Ş’,
‘Ü’,
‘Ö’,
‘I’]

f = open(“myfile.txt”, “w”)
r =random.randrange(1,7)
print(r)
for row in c.execute(‘SELECT * FROM wordlist where word_len = ? ORDER BY RANDOM() LIMIT 1;’ , (r,)):
# if(row[0].length() > 0):
while(row[0] > 0):
print(row[1])
# else:
# print(“wth?”)
# # if ‘k’ in row[1]:

# if any(x in row[1] for x in l):
# print(‘DELETE FROM wordlist where word_id =’,row[0],row[1])
# f.write(‘DELETE FROM wordlist where word_id =’ + str(row[0]) + “;\n” )

# c.execute(‘DELETE FROM wordlist where word_id = ?’, (str(row[0]),) )
#conn.commit()
# if row[1].find(‘Ş’) is not -1:
# print(row[1])

# conn.close()
[/sourcecode]