source: orange/orange/doc/modules/sql-new2.py @ 6538:a5f65d7f0b2c

Revision 6538:a5f65d7f0b2c, 545 bytes checked in by Mitar <Mitar@…>, 4 years ago (diff)

Made XPM version of the icon 32x32.

Line 
1# Description: Reads data from a database
2# Category:    file formats
3# Classes:     orngSQL.SQLReader
4# Referenced:  orngSQL.htm
5
6import orange, orngSQL
7
8r = orngSQL.SQLReader('mysql://user:somepass@localhost/test')
9r.query = "SELECT * FROM bus WHERE line='10';"
10r.discreteNames = ['weather', 'arrival', 'daytime']
11r.metaNames = ['id']
12r.className = 'arrival'
13r.update()
14print r.metaNames
15print r.discreteNames
16data = r.data()
17for x in data:
18    print x
19
20print
21for a in data.domain.attributes:
22    print a
23
24print 'Class:', data.domain.classVar
Note: See TracBrowser for help on using the repository browser.