TecUtils

Software screenshot:
TecUtils
Dettagli del software:
Versione: 0.4.0
Data di caricamento: 20 Feb 15
Licenza: Libero
Popolarità: 4

Rating: nan/5 (Total Votes: 0)

TecUtils è un software che offre varie utilità per accelerare lo sviluppo di programmi di progettazione da utilizzare MySQL come database e sostituire l'uso di variabili globali.
TecUtils contiene i seguenti moduli:
- Mydb
- Envvar
mydb:
Richiede:
& Nbsp; & nbsp; & nbsp; mysql-python
Fornisce:
& Nbsp; & nbsp; & nbsp; Ci sono tre funzioni che prendono cura l'interazione del database:
& Nbsp; & nbsp; & nbsp; - GetRecordset (sHost, suser, spwd, SDB, sSQL)
& Nbsp; & nbsp; & nbsp; - GetData (sHost, suser, spwd, SDB, sSQL)
& Nbsp; & nbsp; & nbsp; - ExecuteSQL (sHost, suser, spwd, SDB, sSQL)
::
import TecUtils.mydb
myhost = "localhost"
myUser = "root"
MyPwd = "password"
myDB = "test"
TecUtils.mydb.ExecuteSQL (myhost, myUser, MyPwd, myDB "INSERT INTO animale (nome, categoria) VALORI" +
& Nbsp; & nbsp; & nbsp; ('Serpente', 'rettile'), ('rana', 'anfibio'), ('tonno', 'pesce'), ('racoon', 'mammifero'), ('lucertola', 'rettile') " )
sql = "SELECT name FROM WHERE animale category = 'rettile'"
TecUtils.mydb.GetRecordset (myhost, myUser, MyPwd, myDB, sql)
thistype = 'pesce'
sql = "SELECT Nome FROM WHERE animale category = '% s'"% thistype
TecUtils.mydb.GetData (myhost, myUser, MyPwd, myDB, sql)
::
envvar:
Fornisce:
& Nbsp; & nbsp; & nbsp; Legge un file contenente = e carichi in un contenitore, in modo da poter utilizzare container.var
& Nbsp; & nbsp; & nbsp; getVarFromFile (filename, container)
Usa:
::
db = getVarFromFile ('config / db.cfg', 'db')
::
Esempi:
Se utilizzare i due moduli fornisce un modo per utilizzare un file di configurazione per l'accesso de database:
::
# Questo è il file di configurazione:
# Db.cfg
HOST = 'localhost'
USER = 'root'
PWD = 'ahivoy'
DB = 'facturae'
::
e utilizzarlo in un programma:
::
TecUtils importazione
TecUtils.envvar.getVarFromFile ('db.cfg', db)
data = TecUtils.mydb.GetRecordset (db.HOST, db.USER, db.PWD, db.DB, "SELECT * FROM animale")
per animali nei dati:
& Nbsp; & nbsp; & nbsp; animal print [0]
::

Requisiti :

  • Python

Programmi simili

DTGen
DTGen

20 Feb 15

EasyDB
EasyDB

14 Apr 15

S3QL
S3QL

20 Feb 15

Dobbin
Dobbin

14 Apr 15

Commenti a TecUtils

I commenti non trovato
Aggiungi commento
Accendere le immagini!