03 2021 档案

摘要:函数装饰器的工作原理,假设用 funA() 函数装饰器去装饰 funB() 函数,如下所示: 1 #funA 作为装饰器函数 2 def funA(fn): 3 #... 4 fn() # 执行传入的fn参数 5 #... 6 return '...' 7 8 @funA 9 def funB(): 阅读全文
posted @ 2021-03-29 12:05 outsider078 阅读(415) 评论(0) 推荐(0)
摘要:记得在app01下的models中搞定模型类建立迁移文件:python manage.py makemigrations根据迁移文件在指定数据库中生成表:python manage.py migratecreate database book character set utf8;创建数据库设置字符 阅读全文
posted @ 2021-03-18 15:45 outsider078 阅读(518) 评论(0) 推荐(0)
摘要:记得在app01下的models中搞定模型类建立迁移文件:python manage.py makemigrations根据迁移文件在指定数据库中生成表:python manage.py migratecreate database book character set utf8;创建数据库设置字符 阅读全文
posted @ 2021-03-17 20:12 outsider078 阅读(361) 评论(0) 推荐(0)
摘要:HTML 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 <title>明</title> 6 <link rel="stylesheet" type="text/css" href="css/页面效果.css"/> 阅读全文
posted @ 2021-03-15 15:26 outsider078 阅读(302) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <link rel="stylesheet" type="text/css" href="./css/banner.css"/> </head> <body> < 阅读全文
posted @ 2021-03-15 15:21 outsider078 阅读(168) 评论(0) 推荐(0)
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 <title></title> 6 <style type="text/css"> 7 8 .list1 { 9 float:left; 10 list-style: n 阅读全文
posted @ 2021-03-15 15:18 outsider078 阅读(243) 评论(0) 推荐(0)
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 <title></title> 6 </head> 7 <body> 8 <style type="text/css" > 9 10 body{ 11 12 backgr 阅读全文
posted @ 2021-03-15 15:17 outsider078 阅读(3330) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>定时切换</title> <link rel="stylesheet" type="text/css" href="css/效果.css"/> <script type="text 阅读全文
posted @ 2021-03-15 15:12 outsider078 阅读(730) 评论(0) 推荐(0)
摘要:import re from lxml import etree import requests from bs4 import BeautifulSoup import requests url = 'https://www.qiushibaike.com/imgrank/' headers = 阅读全文
posted @ 2021-03-15 15:05 outsider078 阅读(78) 评论(0) 推荐(0)
摘要:import os import re import requests import json import urllib url = 'http://pic.gamersky.com/home/getimagesindex?sort=time_desc&pageIndex=1&pageSize=5 阅读全文
posted @ 2021-03-15 15:02 outsider078 阅读(93) 评论(0) 推荐(0)
摘要:# 图片爬取 import re import urllib import urllib.request def gethtml(url): page=urllib.request.urlopen(url) html=page.read() return html def getimg(html): 阅读全文
posted @ 2021-03-15 15:00 outsider078 阅读(111) 评论(0) 推荐(0)
摘要:在web访问中常用的服务器提示代码:404表示未找到页面文件(排错:文件名错误,或路径错误),500表示编译错误 一、jsp的基本结构 1 <!-- JSP中的指令标识,只能jsp文件中,包含对当前jsp文件的属性设置,比如:语言,编码,导入包 --> 2 <%@ page language="ja 阅读全文
posted @ 2021-03-15 14:56 outsider078 阅读(202) 评论(0) 推荐(0)
摘要:对列表去重: 循环去重(for) 1 li = [1, 2, 3, 3, 4, 2, 3, 4, 5, 6, 1] 2 new_li = [] 3 for i in li: 4 if i not in new_li: 5 new_li.append(i) 6 print(new_li) 键值去重(k 阅读全文
posted @ 2021-03-09 10:59 outsider078 阅读(576) 评论(0) 推荐(0)
摘要:使用时直接创建img文件夹放进去自己想要的图就ok,然后在HTML主页里面修改一下路径就可以用了 HTML: 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 <title>明</title> 6 <link rel=" 阅读全文
posted @ 2021-03-08 08:43 outsider078 阅读(306) 评论(0) 推荐(0)