Created
December 3, 2017 15:19
-
-
Save ayazzali/98c02b3c2fc172e3a74c7a0cf90c3fb2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
conn=sqlite3.connect("db_001.db") | |
cur= conn.cursor() | |
# cur.execute("ALTER TABLE About_military RENAME TO TempOldTable2") | |
tName='T_Question_Answer' | |
# cur.execute("CREATE TABLE "+tName+" (id INTEGER PRIMARY KEY AUTOINCREMENT, Question TEXT, Answer TEXT, Created DATETIME);")# maybu user_id? | |
# cur.execute("INSERT INTO "+tName+" (Question, Answer) SELECT Question, Reply FROM TempOldTable;") | |
#tName='T_Telegram_Messages' | |
cur.execute('SELECT * FROM '+tName) | |
#cur.execute("DROP TABLE "+tName) | |
#cur.execute('SELECT * FROM '+tName) | |
# cur.execute("CREATE TABLE IF NOT EXISTS "+tName+" (message_id INTEGER PRIMARY KEY , Text TEXT, Created DATETIME);")# maybu user_id? | |
#cur.execute("ALTER TABLE "+tName+" ADD COLUMN user TEXT ") | |
#conn.commit() | |
print(cur.rowcount) | |
print(cur.fetchall() ) | |
# cur.execute("SELECT * FROM About_military;") | |
# print ( cur.fetchall()) | |
//транслитерация | |
# INSERT INTO About_military (Question Answer) values('sdsd','sdsdsd') | |
# symbols = (u"абвгдеёжзийклмнопрстуфхцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ", | |
# u"abvgdeejzijklmnoprstufhzcss_y_euaABVGDEEJZIJKLMNOPRSTUFHZCSS_Y_EUA") | |
# tr = {ord(a):ord(b) for a, b in zip(*symbols)} | |
# # for Python 2.*: | |
# # tr = dict( [ (ord(a), ord(b)) for (a, b) in zip(*symbols) ] ) | |
# text = u'Добрый Ден' | |
# print text.translate(tr) # looks good |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment