Skip to main content

mysql operate

Project description

Info
====
`dbop 2018-08-10`

`Author: Zhao Mingming <471106585@qq.com>`

`Copyright: This module has been placed in the public domain.`

`version:0.0.0.1`
`version:0.0.0.2`
- `use zprint`: print log stderr and stdout

Classes:
- `dbop`: oprate the mysql db

Functions:

- `test()`: test function

How To Use This Module
======================
.. image:: funny.gif
:height: 100px
:width: 100px
:alt: funny cat picture
:align: center

1. example code:

.. code:: python
from dbop import dbop as dbop
#pool = PooledDB(MySQLdb,1,host='122.152.206.246',user='oco',passwd='MyNewPass4!',db='task_zmm',port=3306,charset='utf8')
#dbb0=dbop("122.152.206.246","oco","MyNewPass4!")
#db0l=dbb0.run("show databases;")
#print(db0l)
dbb=dbop("172.23.250.51","root","20180712")
dbl=dbb.run("show databases;")
#print dbb.run("use test0720")
#print dbb.run("desc test0720xml")
xml_num=0
jpg_num=0
for dbname in dbl:
if "fourgesture_detection_train" not in dbname[0]:
continue
#print dbname
sqlstr="use %s;"%(dbname[0])
dbb.run(sqlstr)
sqlstr="select count(*) from %sxml;"%(dbname[0])
rr=dbb.run(sqlstr)
xml_num+=dbb.getnum(rr)
xml_numtmp=dbb.getnum(rr)
sqlstr="select count(*) from %simg"%(dbname[0])
rr=dbb.run(sqlstr)
jpg_num+=dbb.getnum(rr)
jpg_numtmp=dbb.getnum(rr)
if xml_numtmp>0:
print dbname[0]
print "xmltmp:%d,jpgtmp:%s"%(xml_numtmp,jpg_numtmp)
print "xml:%d,jpg:%s"%(xml_num,jpg_num)
print dbb.help("sql")
#print len(dbl)
#print type(list(dbl))
#for db in dbl:
# print list(db)



Refresh
========



Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbop-0.0.0.2.tar.gz (5.8 kB view details)

Uploaded Source

Built Distributions

dbop-0.0.0.2-py2.7.egg (8.6 kB view details)

Uploaded Source

dbop-0.0.0.2-py2-none-any.whl (6.8 kB view details)

Uploaded Python 2

File details

Details for the file dbop-0.0.0.2.tar.gz.

File metadata

  • Download URL: dbop-0.0.0.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.4.5

File hashes

Hashes for dbop-0.0.0.2.tar.gz
Algorithm Hash digest
SHA256 3df42005dc24bcc69308110908e4f94497c6b851bbc251cfca50a806643e0a12
MD5 61222ad0821f51929f1495473c97fd1b
BLAKE2b-256 18a73e057fc54dd072f1aa37624e263834d4da2626291b91380a5e142ed49b98

See more details on using hashes here.

File details

Details for the file dbop-0.0.0.2-py2.7.egg.

File metadata

  • Download URL: dbop-0.0.0.2-py2.7.egg
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.4.5

File hashes

Hashes for dbop-0.0.0.2-py2.7.egg
Algorithm Hash digest
SHA256 60e4ec7c6876c3d79af09d29cfc2a90ae152e6639f7715c35fa9e17001444a20
MD5 d398cae7b47ed006e5b6e53254eb14d6
BLAKE2b-256 801890d8fb987d49e6da64750f3d75a92831438c924d59f10812d663a19c3591

See more details on using hashes here.

File details

Details for the file dbop-0.0.0.2-py2-none-any.whl.

File metadata

  • Download URL: dbop-0.0.0.2-py2-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.4.5

File hashes

Hashes for dbop-0.0.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 cc6dc0f447c1d28cdf6f4166d762316db0588c161536236ca6dcd35b88223be3
MD5 69c95968a3f4e6b398e2bc756d77b131
BLAKE2b-256 bcb7a4931a98f408f507bd97f29a44b925c6e0596b89505a177746076684c03c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page