forigi-korektitajn-frazojn.py
author viric <viriketo@gmail.com>
Sun, 13 Feb 2011 22:51:39 +0100
changeset 6 66becdcbe5d9
parent 0 6371497b4e53
permissions -rwxr-xr-x
Ara em va allò dels events
viric@0
     1
#!/usr/bin/python
viric@0
     2
# -*- coding: utf-8 -*-
viric@0
     3
viric@0
     4
import MySQLdb,sys
viric@0
     5
viric@0
     6
database = 'lingvigilo'
viric@0
     7
dbuser = 'lingvigilouser'
viric@0
     8
dbpass = 'carrinclo'
viric@0
     9
dbtable = 'frazoj_ru_ca'
viric@0
    10
viric@0
    11
if (len(sys.argv) != 2):
viric@0
    12
	print "Uzo: " + sys.argv[0] + " <numero>"
viric@0
    13
	print "Parametro <numero>:"
viric@0
    14
	print " 0    Ne korektitaj"
viric@0
    15
	print " 1    Ĝustaj"
viric@0
    16
	print " 2    Malĝustaj"
viric@0
    17
	print " 3    Nekutimaj"
viric@0
    18
	sys.exit(1)
viric@0
    19
else:
viric@0
    20
	korekteco=sys.argv[1]
viric@0
    21
viric@0
    22
db = MySQLdb.connect(host='vicerveza',user=dbuser,passwd=dbpass,db=database)
viric@0
    23
viric@0
    24
cursor = db.cursor()
viric@0
    25
viric@0
    26
cursor.execute('DELETE FROM ' + dbtable + ' WHERE korekta='+sys.argv[1])
viric@0
    27
viric@0
    28
db.close()