AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
## 什么是代码? 代码是现实世界事物在计算机世界中的映射 ## 什么是写代码? 写代码是将现实世界中的事物用计算机语言来描述 [Urllib库的基本使用](http://www.cnblogs.com/zhaof/p/6910871.html) Redis ``` #!/usr/bin/python3 import redis class BaseRedis: def __init__(self): if not hasattr(BaseRedis, 'pool'): BaseRedis.create_pool() self._connection = redis.Redis(connection_pool = BaseRedis.pool) @staticmethod def create_pool(): BaseRedis.pool = redis.ConnectionPool(host = '127.0.0.1') @staticmethod def instance(): return self._connection r = BaseRedis.instance print(r) ```