随笔分类 - Python
摘要:import os import datetime from django.test import TestCase # Create your tests here. import requests import re import json import subprocess from conc
阅读全文
摘要:1. 安装uwsgi 执行命令: pip3 install uwsgi 2. 配置uwsgi文件(django项目的主目录下新建uwsgi.ini) [uwsgi] # 指定ip(内网ip) # http = 172.18.64.217:8000 # 项目虚拟环境(使用python的虚拟环境时需要配
阅读全文
摘要:第一步: 在settings.py文件中导入loguru模块并配置日志文件路径和格式等信息 from loguru import logger BASE_DIR = Path(__file__).resolve(strict=True).parent.parent #设置主日志文件,所有日志都会记录
阅读全文
摘要:import pymysqldb = pymysql.connect(host='localhost', user='root', password='123456', database='test',port=3306)cursor = db.cursor()# 方式1:Python的字符串格式化
阅读全文
摘要:前言 pymsql是Python中操作MySQL的模块,其使用方法和MySQLdb几乎相同。但目前pymysql支持python3.x而后者不支持3.x版本。 本文测试python版本:2.7.11。mysql版本:5.6.24 一、安装 1 pip3 install pymysql 二、使用操作
阅读全文
摘要:将接口相关信息写入到Excel中,然后用此脚本从Excel中读取相应的信息并组装成URL来发送接口并获取返回的结果,并将结果写入到对应的用例中.
阅读全文
摘要:#coding:utf-8import unittestimport osimport sysimport HTMLTestRunnercase_path = os.path.join(os.path.dirname(os.path.realpath(__file__)))report_path =
阅读全文
摘要:#!/user/bin/env python # -*-coding:utf-8-*- from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.image import MIMEImage from email.mime.base import MIME...
阅读全文

浙公网安备 33010602011771号