摘要:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.Collecting requests Could not fetch URL https 阅读全文
摘要:
class MenuList(admin.ModelAdmin): list_display = ('menuId', 'menuName', 'menuDesc', 'menuType', 'sort_order') def formfield_for_foreignkey(self, db_fi 阅读全文
摘要:
问题: 在做接口自动化测试的时候,请求报文是json串,但是根据项目规则必须转换成字符串,然后在开头拼接“data=” 接口中很多入参值需要进行参数化。 解决方案: 1、Python并没有对在字符串中简单替换变量值提供直接的支持。 但是通过使用字符串的 format() 方法来解决这个问题。比如: 阅读全文
摘要:
python操作oracle数据库需要使用到cx-oracle库。 安装:pip install cx-oracle python连接oracle数据库分以下步骤: 1、与oracle建立连接; 2、获取游标; 3、执行sql语句; 4、fetch查询结果或commit修改结果; 5、关闭游标; 6 阅读全文
摘要:
python操作mysql数据库需要使用到mysqlclient库。 安装:pip install mysqlclient python连接mysql数据库分以下步骤: 1、与mysql建立连接; 2、获取游标; 3、执行sql语句; 4、fetch查询结果或commit修改结果; 5、关闭游标; 阅读全文
摘要:
1,登陆root帐号 2,cd /etc/yum.repo.d 3,mv CentOS-Base.repo CentOS-Base.repo.bak4,wget http://mirrors.aliyun.com/repo/Centos-7.repo5,mv Centos-7.repo CentOS 阅读全文
摘要:
在connect()方法中传入charset='utf8'参数即可。 阅读全文
摘要:
python配置文件读取 阅读全文
摘要:
使用python查询mysql数据库的时候,默认查询结果没有返回表字段名称,不方便使用。为了方便使用一般会选择将查询结果加上字段名称以字典组的方式返回查询结果。 实现如下: 详细原理参考:https://docs.djangoproject.com/en/2.0/topics/db/sql/#exe 阅读全文
摘要:
centos笔记本触控板失效 阅读全文