source: orange/orange/doc/modules/ @ 6538:a5f65d7f0b2c

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

Made XPM version of the icon 32x32.

1# Description: Writes a data set to and reads from an SQL database
2# Category:    file formats
3# Classes:     ExampleTable, orngSQL.SQLReader, orngSQL.SQLWriter
4# Uses:
5# Referenced:  orngSQL.htm
7import orange, orngSQL, orngTree
9data = orange.ExampleTable("iris")
10print "Input data domain:"
11for a in data.domain.variables:
12    print a
13w = orngSQL.SQLWriter('mysql://user:somepass@localhost/test')
14w.create('iris', data)
16r = orngSQL.SQLReader('mysql://user:somepass@puhek/test')
17r.execute('SELECT "petal width", "petal length" FROM iris WHERE "sepal length"<5.0')
18data =
19print "\n%d instances returned" % len(data)
20print "Output data domain:"
21for a in data.domain.variables:
22    print a
Note: See TracBrowser for help on using the repository browser.