码迷,mamicode.com
首页 > 编程语言 > 详细

Python就业班——新闻管理系统

时间:2020-11-20 11:32:53      阅读:8      评论:0      收藏:0      [点我收藏+]

标签:col   back   mysql   https   cli   管理   imp   color   local   

colorama

test.py

#!/usr/bin/env python3
# coding=utf-8
# Version:python3.6.1
# Project:vega
# File:test.py
# Data:2020/9/16 13:20
# Author:LGSP_Harold
from colorama import Back, Fore, Style

print(Fore.LIGHTRED_EX, Hi)
print(Back.LIGHTBLUE_EX, Jim)
print(Style.RESET_ALL, Bye)


if __name__ == __main__:
    pass

 

mysql_db.py

#!/usr/bin/env python3
# coding=utf-8
# Version:python3.6.1
# Project:vega
# File:mysql_db.py
# Data:2020/9/16 15:47
# Author:LGSP_Harold
import pymysql
from DBUtils.PooledDB import PooledDB

__config = {
    host: localhost,
    port: 3306,
    user: root,
    passwd: root,
    db: vega,
    charset: utf8
}

try:
    pool = PooledDB(pymysql, 10, **__config)
except Exception as e:
    print(e)


if __name__ == __main__:
    pass

 

redis_db.py

#!/usr/bin/env python3
# coding=utf-8
# Version:python3.6.1
# Project:Ex_vega
# File:redis_db.py.py
# Data:2020/11/13 16:23
# Author:LGSP_Harold
import redis

try:
    pool = redis.StrictRedis(
        host=localhost,
        port=6379,
        password=root,
        db=3,
        max_connections=20
    )
except Exception as e:
    print(e)


if __name__ == __main__:
    pass

 

mongo_db.py

#!/usr/bin/env python3
# coding=utf-8
# Version:python3.6.1
# Project:Ex_vega
# File:mongo_db.py
# Data:2020/11/14 12:01
# Author:LGSP_Harold
from pymongo import MongoClient

try:
    client = MongoClient(host=localhost, port=27017)
    client.admin.authenticate(admin, admin)
except Exception as e:
    print(e)


if __name__ == __main__:
    pass

 

gitee:https://gitee.com/lgsp_Harold/Ex_vega

Python:3.6

Redis:3.2.100

Mysql:8.0.17

MongoDB:4.0.11

效果图:自行运行代码查看或自行幻想....

Python就业班——新闻管理系统

标签:col   back   mysql   https   cli   管理   imp   color   local   

原文地址:https://www.cnblogs.com/Harold-Hua/p/13680762.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!