码迷,mamicode.com
首页 >  
搜索关键字:python 笔记    ( 201513个结果)
特有的字符串格式化函数format——python篇
format 格式化函数 字符串调用方法format,并提供要设置其格式的值。 str.format() 方法通过字符串中的大括号{} 来识别替换字段 ,从而完成字符串的格式化。 字段名: 省略字段名:{} 使用非负十进制整数{0} 变量名 省略字段名 大括号内省略字段名,根据位置参数参数。 替换字 ...
分类:编程语言   时间:2020-06-20 11:42:00    阅读次数:75
python项目_跨域问题
1.可以通过settings/dev.py的ALLOWED_HOSTS,设置允许访问 # 设置哪些客户端可以通过地址访问到后端 ALLOWED_HOSTS = [ 'api.luffycity.cn', ] 2.安装跨域模块(一下代码修改都是在settings.dev下进行的) pip instal ...
分类:编程语言   时间:2020-06-20 11:36:32    阅读次数:76
python脚本随便记录一次
1 # -*- coding: utf-8 -*- 2 """ 3 Created on Mon Nov 25 17:07:26 2019 4 5 @author: user 6 """ 7 8 import pandas as pd 9 from pathlib import Path 10 im ...
分类:编程语言   时间:2020-06-20 11:30:33    阅读次数:56
python项目_mysql数据库的使用
1.首先自己创建数据库 create database luffy default charset=utf8mb4; 2.为当前项目创建数据库用户 create user luffy_user identified by 'luffy'; grant all privileges on luffy. ...
分类:数据库   时间:2020-06-20 11:29:22    阅读次数:79
字典——python基础篇
字典是什么 字典是无序、可变的容器型数据类型,元素以键值对存储,以键获值。 什么时候用字典:需要保存多个数据,并需要对数据(多个数据的意义不同)进行区分。 字典是容器型数据类型,容器的标志{},多个元素用逗号隔开。 字典的元素都是键值对,以键获值。{key1:value1,key2:value2,. ...
分类:编程语言   时间:2020-06-20 11:14:24    阅读次数:62
python项目_添加异常处理
新建utils/exceptions.py from rest_framework.views import exception_handler from django.db import DatabaseError from rest_framework.response import Respo ...
分类:编程语言   时间:2020-06-20 11:11:43    阅读次数:75
3-7.python函数的基础调用之异常1(IndentationError: unindent does not match any outer indentation level)
代码: 结果: PS E:\30.Study\30.自动化测试\99.零基础入门 Python Web 自动化测试\10.seleniumCodePractice> & "C:/Program Files/Python38/python.exe" "e:/30.Study/30.自动化测试/99.零 ...
分类:编程语言   时间:2020-06-20 11:09:48    阅读次数:76
python应用 曲线拟合03
问题 有许多待拟合的曲线,需批量拟合。 解决 写一个类 1 # -*- coding: utf-8 -*- 2 """ 3 @author: kurrrr 4 """ 5 6 import numpy as np 7 import matplotlib.pyplot as plt 8 import ...
分类:编程语言   时间:2020-06-20 11:07:00    阅读次数:61
解决Error: Can't find Python executable "python", you can set the PYTHON env variable
在执行 yarn start时遇到问题, 最后一行提示 Run `npm rebuild node-sass` to download the binding for your current environment. 于是按提示操作 输入命令 npm rebuild node-sass 的时候有时 ...
分类:编程语言   时间:2020-06-20 11:06:29    阅读次数:118
unittest模块在linux报错: AttributeError: module 'unittest' has no attribute 'TestRunner'
一开始在windows下运行没有问题,但是在linux下运行却报如下错误: ? AttributeError: module 'unittest' has no attribute 'TestRunner', 在网上找了好多资料看了一下都提示存在与unittest模块同名的.py文件 但是我查了一点 ...
分类:系统相关   时间:2020-06-20 10:43:27    阅读次数:68
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!