摘要: 这个问题百度了一下,各种各样的的回答都有,试了好多种方法,终于解决这个问题 解决方法: 1.在项目根目录下,新建 vue.config.js, 在文件中输入: module.exports = { publicPath: process.env.NODE_ENV 'production' ? './ 阅读全文
posted @ 2021-07-18 12:54 十一的杂文录 阅读(842) 评论(2) 推荐(0) 编辑
摘要: 网上有资料但是不全,所以这里记录一份比较全的 1.创建项目 2.编辑 demo.cpp 这里写button用来做国际化示例,运行软件后是这个样子 #include "demo.h" #include "ui_demo.h" #include <QPushButton> demo::demo(QWid 阅读全文
posted @ 2021-07-14 16:51 十一的杂文录 阅读(441) 评论(1) 推荐(0) 编辑
摘要: FAQ1:在使用pip3安装库的时候,提示需要升级pip pip3 install --upgrade pip FAQ2:在创建软链接时,提示:ln: failed to create symbolic link ‘/usr/bin/python3’: File exists 我们可以在参数中加个 阅读全文
posted @ 2021-07-11 16:08 十一的杂文录 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 服务器是使用的阿里云的centos 7.6 项目使用的是 Python3.9.5 + Django 3.2.4 目标:将django项目部署到centos上,centos + Python + django + uwsgi + nginx Python下载地址:https://www.python. 阅读全文
posted @ 2021-07-11 15:37 十一的杂文录 阅读(291) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2021-06-27 00:43 十一的杂文录 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 有时候我们的网页会被别人内嵌别人的网页 iframe 中,我们只需要在页面中增加以下js就可以让我们的页面内容单独显示出来,不被嵌入到 iframe中 核心JS代码 <script> if(top.location != self.location){ // 检查当前页面是否处于浏览器顶层 top. 阅读全文
posted @ 2021-06-06 19:52 十一的杂文录 阅读(135) 评论(0) 推荐(0) 编辑
摘要: win7电脑 IE浏览器 开发人员工具,不能切换IE版本 这个是IE浏览器的问题,需要安装个微软件东西就可以解决这个问题了。亲测有效 64位下载地址:https://wwi.lanzoui.com/i71Ohpqcfle(我放在蓝奏云) 阅读全文
posted @ 2021-06-03 09:23 十一的杂文录 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 当页面失去焦点(切换到其他标签页 / 切换到其他软件),触发失焦事件,然后动态删除element 兼容IE8 if(window.ActiveXObject){ window.attachEvent('onblur', function(){ document.getElementById('Elo 阅读全文
posted @ 2021-05-29 10:20 十一的杂文录 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 核心代码 import compileall compileall.compile_file("a.py", legacy=True, force=True) 演示步骤 1.新建 a.py,定义一个函数,供其他程序调用 # a.py 定义一个函数,提供给其他程序调用 def func(n1, n2) 阅读全文
posted @ 2021-05-25 01:05 十一的杂文录 阅读(576) 评论(0) 推荐(0) 编辑
摘要: // 鼠标移动出现雪花.html <!DOCTYPE html> <html> <head> <title></title> <script src="https://wow.techbrood.com/libs/jquery/jquery-1.11.1.min.js"></script> </he 阅读全文
posted @ 2021-05-05 21:25 十一的杂文录 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 新建js文件,将代码复制到js文件中,然后在HTML文件中引入js,这样鼠标点击后就可以出现爱心 // js.js !function(e, t, a) { function r() { for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t. 阅读全文
posted @ 2021-05-05 21:22 十一的杂文录 阅读(290) 评论(0) 推荐(0) 编辑
摘要: <div id="first"> <p>带背景颜色的小三角实现是比较简单的</p> <span id="top"></span> </div> <style> #top{ position:absolute; width:0px; height:0px; line-height:0px; borde 阅读全文
posted @ 2021-05-05 21:19 十一的杂文录 阅读(396) 评论(0) 推荐(0) 编辑
摘要: 这是来自一个妹子的需求,需要将多张图片拼接成一张长图 我是使用pillow这个库来实现的,下面的简单的代码,操作比较简单,代码还有优化的空间 def test(dirpath): ims = [Image.open(os.path.join(dirpath, i)) for i in os.list 阅读全文
posted @ 2021-05-04 16:36 十一的杂文录 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 发送的是带附件的邮件,发送完成后,去检查发现,附件变成二进制文件了 出错的代码主要是这一句: att1["Content-Disposition"] = 'attachment; filename="test.txt"' 只要改正这里就可以了 问题代码 att1 = MIMEText(open('t 阅读全文
posted @ 2021-04-23 01:09 十一的杂文录 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 设置抄送人,非常简单,只需要添加一条信息就可以了,例: cc_list = ['xx@xxx.cn', 'xx@xxx.cn'] msg['Cc'] = ','.join(cc_list) smtp.sendmail(name, to_list + cc_list, msg.as_string()) 阅读全文
posted @ 2021-04-23 01:00 十一的杂文录 阅读(3086) 评论(0) 推荐(1) 编辑
摘要: 在使用腾讯企业邮箱发送邮件时出现报错:AttributeError: 'list' object has no attribute 'encode' 原因:收件人不能用列表存储数据,需要转为字符串,以逗号分割 解决方法: 将收件人列表转为字符串,以逗号分割 to_list = ['a@xx.com' 阅读全文
posted @ 2021-04-23 00:53 十一的杂文录 阅读(5152) 评论(0) 推荐(0) 编辑
摘要: 快速的统计出字符出现的次数,并以字典显示出来 import pprint msg = 'It was a bright cold day in April, and the clocks were strikingthirteen' count = dict() for i in msg: coun 阅读全文
posted @ 2021-04-18 16:42 十一的杂文录 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Windows版 格式化代码(可以去除多余空格):Alt + shift + F 折叠代码:ctrl + shift + 【 展开代码:ctrl + shift + 】 向上复制行:Alt + shift + UP 向下复制行:Alt + shift + DOWN 单词选中: ctrl + D 展开 阅读全文
posted @ 2021-04-17 20:56 十一的杂文录 阅读(59) 评论(0) 推荐(0) 编辑
摘要: win7系统部署django项目,在Windows电脑上我使用的是 Apache + mod_wsgi 来部署的 # 背景 Python 3.8.3 Django 3.1.7 Apache v16 mod_wsgi 3.8DB:sqlite3 # 部署前的检查 1.检查下Python的版本 2.检查 阅读全文
posted @ 2021-04-01 00:21 十一的杂文录 阅读(373) 评论(0) 推荐(0) 编辑
摘要: 做了一个小网站,主要是为了简单工作,只需要公司局域网访问,所以部署在自己的台式机上。 网站是用django 3.x版本开发的,电脑是win7系统,所以是用的Apache部署的 部署的啥问题都没有,检查了两三个小时。。。 一直想不通为啥 打开网页就是转圈圈,看log日志也没啥提醒,后面还是百度才知道, 阅读全文
posted @ 2021-03-19 02:15 十一的杂文录 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 一、搭建环境,准备数据 1.1:新建项目 django-admin startproject Test 1.2:新建app python manage.py startapp app 1.3:设置 settings.py # settings.py # 允许访问的ip地址 ALLOWED_HOSTS 阅读全文
posted @ 2021-03-16 22:42 十一的杂文录 阅读(2096) 评论(2) 推荐(0) 编辑
摘要: Coverage 一个专门用来检查代码覆盖率的工具,他的使用非常简单,有两种使用方法:[命令行运行,配合测试套件使用] 安装: pip install coverage 一、准备素材 main.py def get_status(score): if score >= 90: return '优秀' 阅读全文
posted @ 2021-03-15 01:03 十一的杂文录 阅读(1831) 评论(0) 推荐(0) 编辑
摘要: SQL按年月日进行分组 select count(project_name), create_at from table_a group by date_format(create_at, '%Y%m%d'); 阅读全文
posted @ 2021-03-15 00:21 十一的杂文录 阅读(756) 评论(0) 推荐(0) 编辑
摘要: 使用Python可以轻松的查询出上周几是多少号,这周几是什么多少号,以下是查询上周五的示例: import datetime, calendar last = datetime.date.today() oneday = datetime.timedelta(days=1) while last.w 阅读全文
posted @ 2021-03-15 00:16 十一的杂文录 阅读(402) 评论(0) 推荐(0) 编辑
摘要: # 清屏 >> cls # 查看进程 >> tasklist # 结束进程 >> tskill <pid> # 查询WIFI列表所有WIFI的信息 >> netsh wlan show networks # 查询无线网卡,当前连接网络详细信息 >> netsh wlan show interface 阅读全文
posted @ 2021-03-14 22:27 十一的杂文录 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 记录一个小知识: 自定义Windows系统盘符的图标,其实这个东西很简单,就像设置U盘的图标一样 首先准备一张ico图片,如果没有ico图片,只有jpg或其他格式的,可以使用这个在线转ico的网站,把图片转换成ico的 免费在线jpg转ico:https://www.aconvert.com/cn/ 阅读全文
posted @ 2021-03-11 14:45 十一的杂文录 阅读(681) 评论(0) 推荐(0) 编辑
摘要: 故事背景是这样的: 为了方便工作中数据的整理,需要开发一个 管理系统,用于记录一些事情。 该系统不需要精美的前端的页面,只需要使用django的admin后台管理就可以了。 我需要在添加数据的时候,把操作员自动的添加进去 解决方法: 在admin的 ModelAdmin 这个类中有一个方法:save 阅读全文
posted @ 2021-03-10 14:06 十一的杂文录 阅读(545) 评论(0) 推荐(0) 编辑
摘要: 今天在使用 Djangorestframework 这个框架时,发生报错: ImportError: Could not import 'rest_framework.authentication.ToKenAuthentication' for API setting 'DEFAULT_AUTHE 阅读全文
posted @ 2021-03-07 16:24 十一的杂文录 阅读(647) 评论(0) 推荐(0) 编辑
摘要: 代理模式: 引入一个代理对象以代替真实的对象,解耦调用方和被调用方之间的联系 # 代理模式:引入一个代理对象以代替真实的对象,解耦调用方和被调用方之间的联系 from os import name from time import sleep from win32com.client.makepy 阅读全文
posted @ 2021-03-02 09:55 十一的杂文录 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 构建者模式: 将一个复杂对象的构造与表现进行分离,利用多个步骤进行创建,同一个构建过程可用于创建多个不同的表现 构建者模式一般由 Director(指挥官)和 Builder(建设者)构成 class Car: def __init__(self): self.money = None self.a 阅读全文
posted @ 2021-03-02 09:45 十一的杂文录 阅读(103) 评论(0) 推荐(0) 编辑