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.4.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for amhhandler-1.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 384e9d6fcec79c3c11d570b82d5bf67ec222e60e567af8d81ac85465e47e8177 |
|
MD5 | 65f5247ce54965c788de5f830b7b1fce |
|
BLAKE2b-256 | 986d3dfeb247ca59ca4cec98036ab263b469e6a5eec9b4ab0cc97aa116e835a0 |