上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 37 下一页
摘要: 采用前后端分离机制后,前端静态资源会采用额外的前端服务器来提供静态文件服务。 为了简化服务器的搭建和使用,依然使用Django来提供静态文件服务,将所有的静态资源文件按照文件夹路径创建对应的视图处理函数。以文件读取方式获取文件内容并通过HttpResponse返回。 上传图像,并展示图像的js脚本 阅读全文
posted @ 2021-09-03 13:12 索匣 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 报错这个缘由是在配置路由url上 urlpatterns 写成了 urlpattern 格式如下: urlpatterns = [ path('',home,name = 'home'), # 这里的逗号忘加了,很久没写了 ] django.core.exceptions.ImproperlyCon 阅读全文
posted @ 2021-09-03 13:11 索匣 阅读(224) 评论(0) 推荐(0) 编辑
摘要: ''' 一般来说,数组的所有操作都是以元素对应的方式实现的 即同时应用于数组的所有元素,且一一对应 ''' import numpy as np arr1 = np.arange(4) arr2 = np.arange(10,14) print(arr1,arr2) #加法 print(arr1 + 阅读全文
posted @ 2021-09-02 19:22 索匣 阅读(83) 评论(0) 推荐(0) 编辑
摘要: ''' 在创建数组的时候,通常用一个常量值(一般为0或1)初始化一个数组, 这个值通常会作为加法和乘法循环的起始值 ''' import numpy as np print(np.zeros(5,dtype=float)) # 5个浮点数类型的一维数组 print(np.zeros(3,dtype= 阅读全文
posted @ 2021-09-02 19:21 索匣 阅读(47) 评论(0) 推荐(0) 编辑
摘要: import numpy as np # 多维数组的索引与切片 arr2 = np.arange(8).reshape(2,4) # 将数组转换成2行4列 print('原先的2行4列的元素',arr2) print(arr2[1,2:3]) # 返回第二行,第三列的值 print(arr2[:,2 阅读全文
posted @ 2021-09-02 19:20 索匣 阅读(256) 评论(0) 推荐(0) 编辑
摘要: ''' numpy可以创建一个n维数组对象(ndarray) ndarray是一种快速并且节省空间的多维数组 它可以提供数组话的算数运算和高级的广播功能 ''' import numpy as np # 先用列表展示下二维数组 LIST = [[1,2],[3,4]] print('列表的二维数组' 阅读全文
posted @ 2021-09-02 19:18 索匣 阅读(53) 评论(0) 推荐(0) 编辑
摘要: """ 数组中的元素只能是同种数据类型;列表中的元素可以不是同一种数据类型 """ from typing import List import numpy as np LIST = [1,23,4,5] ARR = np.array(LIST) # 会报错,没报错啊,这数组哎,列表直接转换数组就行 阅读全文
posted @ 2021-09-02 19:17 索匣 阅读(617) 评论(0) 推荐(0) 编辑
摘要: import os import re import sys #要修改的文件的文件夹路径 path=r"D:\\百度网盘企业版\\a_pactice\\picLibs" #要批量修改的文件的后缀名为 src_hzm="png" fileList = os.listdir(path) # 列出该文件夹 阅读全文
posted @ 2021-08-30 21:31 索匣 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 任意链接生成二维码,并把把图片镶嵌在二维码中 食用方式 更改creat_qrcode(url,fikename)对应的两个参数即可 import qrcode # 二维码生成包 from PIL import Image # 图片处理包 def creat_qrcode(url,filename): 阅读全文
posted @ 2021-08-14 20:32 索匣 阅读(75) 评论(0) 推荐(0) 编辑
摘要: 导航栏组件的差异 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" co 阅读全文
posted @ 2021-08-14 14:26 索匣 阅读(95) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 37 下一页