if querry:
dataset = querry.split()
if len(dataset) >= 5:
with sqlite3.connect('aybremote') as connection:
cursor = connection.cursor()
cursor.execute('INSERT INTO main VALUES(?,?,?,?,?)', dataset[0:5])
connection.commit()
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
import re
test = """Text - true
TeXt - true
teXt - true
TEXT - true
text - false"""
reg1 = re.compile(ur"([Tt][Ee][Xx][Tt])(?<!text)")
reg2 = re.compile(ur"(?!text)([Tt][Ee][Xx][Tt])")
print reg1.findall(test)
print reg2.findall(test)
Z:\>test.py
['Text', 'TeXt', 'teXt', 'TEXT']
['Text', 'TeXt', 'teXt', 'TEXT']
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
from collections import namedtuple
ntrow = namedtuple('ntrow', "f0, f1, mydata, f3")
with open('data.log', 'r') as f:
for line in f:
splitted = line.strip().split(', ')
if len(splitted) == 4:
entry = ntrow(*splitted)
if entry.mydata.isdigit():
print int(entry.mydata)