File: example.py

package info (click to toggle)
sql-editor 0.4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 116 kB
  • ctags: 140
  • sloc: python: 1,091; makefile: 46; sh: 28
file content (30 lines) | stat: -rw-r--r-- 462 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#example of usage of MySQLdb and _mysql
import MySQLdb
import _mysql
import classes
import sys
import gtk

thedb="test"
thetable="visit"
thehost="localhost"
theuser="root"
thepasswd=""


#connect
db = MySQLdb.connect(host=thehost, user=theuser,
                     passwd=thepasswd)

for t in ["person", "visit","lecture","event","classroom","course"]:
    w = classes.editor(db,thedb,t)
    w.connect("delete_event", gtk.mainquit)


gtk.mainloop()

del db