An even better way to work with Python.
Project description
shell
from amhhandler import shell
cmd = "ls /tmp"
result, rcode = shell.run(cmd)
if rcode == 0:
print(result)
else:
print('execute error: {0}'.format(result))
mysql
from amhhandler import mysql
dbconfig = {"host":"127.0.0.1","port":3306, "user":"admin", "password":"123456", "db":"mysql"}
dbHandler = mysql.Conn(**dbconfig)
sql = "select * from mysql.user where user='admin';"
result = dbHandler.select(sql)
dbHandler.close()
ding ding robot
logging
from amhhandler import logger
log = logger.log2file('/tmp/run.log')
log.info('execute log')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
amhhandler-1.2.3.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for amhhandler-1.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 596baaea105d4bd852eff6ac8e026cc7d356407a0fec1cc7de9f95ea09dd9e84 |
|
MD5 | 5581dff48108ef4ee7b92e341524a172 |
|
BLAKE2b-256 | 05b60a84a184278ec0c438acf3c0849d7539c0e001bf93e4b6d0b5e742b5e4bf |