- 博客(12)
- 收藏
- 关注
原创 websocket 看着看着 ,也就懂了
1. 什么是websocket?看看官方的解释:WebSocket是一种通信协议,可在单个TCP连接上进行全双工通信。WebSocket使得客户端和服务器之间的数据交换变得更加简单,允许服务端主动向客户端推送数据。在WebSocket API中,浏览器和服务器只需要完成一次握手,两者之间就可以建立持久性的连接,并进行双向数据传输。太复杂了?那就抓住几关键词就行了:双向通信,基于HTML5,所有浏览器在2011年都支持了。还是不太明白?上几张图领悟领悟:wss是ws的加密。文.
2021-07-26 23:08:55 1288
转载 PyQt5+python取色器
import sysfrom PyQt5.QtWidgets import *from PyQt5.QtGui import *from PyQt5.QtCore import *class MainWnd(QWidget): def __init__(self, parent=None): super(MainWnd, self).__init__(parent) self.initUI() timer = QTimer(self) .
2021-07-21 01:07:41 678 1
转载 pyinstaller打包时提示UPX is not available
查了一下, 原来是pyinstaller使用UPX压缩, 所以根据下面的步骤安装了一个UPX就好了:(1) 到官网 https://upx.github.io/ 下载了UPX(我的是Window 32版本), 下载下来是一个压缩包(2) 解压得到 upx.exe文件(3) 把exe文件拷贝到pyinstaller目录下然后再重新运行pyinstaller命令就会提示:UPX is available了。...
2021-07-19 19:22:09 2209 1
原创 python打包以及减少打包exe体积
1. pyinstall打包成exe:pip install pyinstallerpyinstaller -F xx.py# -F:打包成单个exe文件。# -D:默认选项,创建一个目录,包含exe文件以及大量依赖# -c:默认选项,使用cmd控制台。# -w:不是用控制台。# -p:添加搜索路径。# -i:生成exe程序的icon图标。2. 使用pipenv减少打包exe的体积: 2.1 初始打包:# 全局安装pipenvpip install pip...
2021-07-17 23:08:12 1677
原创 python录屏制作
from PIL import ImageGrabimport numpy as npimport cv2import datetimefrom pynput import keyboardimport threadingclass Screencap: def __init__(self): self.flag=False self.init() def init(self): th = threading.Thread(.
2021-07-17 14:20:05 142
原创 react处理绝对路径
1. 在react根项目中,创建jsconfig.json{ "compilerOptions":{ "baseUrl":"src" //src为绝对根目录 }, "include":[ "src" ]}2. 使用:const path=window.require('path');const exePath=path.join('src','**/*.exe'); //获取根目录...
2021-07-17 00:52:48 712 1
原创 微信 dll,包装一下生成 exe 文件,用 Node.js 去调用完成截图
下载PrintScr.exe:https://github.com/liangtongzhuo/electron_screenshot。调用PrintScr.exe:const child_process=require('child_process');const screen_window = child_process.execFile(__dirname + './screen/PrintScr.exe') screen_window.on('exit', function (c
2021-07-17 00:26:27 881
原创 react拖拽获取文件路径
const DomEle=()=>{ const drop = (e) => { e.preventDefault(); e.stopPropagation(); const items = e.dataTransfer.items; if (!items.length) return; if (items[0].kind === 'file' && items[0].webkitGetA.
2021-07-16 00:15:41 1131
原创 react中渲染html
const contentHtml='<p>标签</p>'<div dangerouslySetInnerHTML={{_html:contentHtml}}></div>
2021-07-16 00:04:18 165
原创 react滚动到底部
const DomEle=()=>{ const bottomLine =useRef(null); const scrollToBottom = () => { if (bottomLine && bottomLine.current) { bottomLine.current.scrollIntoView(false); } } useEffect(() => { s.
2021-07-16 00:01:57 1232
原创 react项目配置config-overrides.js
const { override, fixBabelImports, addWebpackAlias, adjustStyleLoaders} = require('customize-cra');const path = require("path");module.exports = override( //按需加载antd fixBabelImports('import', { libraryName: 'antd', libraryDirectory.
2021-07-15 23:51:20 2548
原创 electron中报错Not allowed to load local resource
const mainWindow = new BrowserWindow({ webPreferences: { webSecurity: false } })const startUrl = process.env.NODE_ENV === 'dev' ? 'http://localhost:3000' : path.join(__dirname, "/build/index.html");mainWindow.loadURL(sta.
2021-07-14 22:56:58 3172 2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人