上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 25 下一页
摘要: 之前有一天看到了这样的一段代码,居然可以使用dom的id直接调用方法和获取属性,真是刷新了我的认知了。 <div> <p id="content">aa</p> <button onclick="console.log(content.innerText)">打印内容</button> </div> 阅读全文
posted @ 2023-12-20 15:54 carol2014 阅读(62) 评论(0) 推荐(0)
摘要: 最近要在系统中增加一个桑基图,要求桑基图可以根据选择的分析因子重新绘图。仔细看了下 echarts 的示例,桑基图本身很简单,困难的是如何根据数据资料整理成桑基图的数据格式,并且实现选择分析因子重新绘图。研究了几天的数据资料,特将方法写个 demo 记录下。 <script src="./plugi 阅读全文
posted @ 2023-12-20 11:23 carol2014 阅读(415) 评论(0) 推荐(0)
摘要: 最近在优化一个页面:ajax请求异步数据,特定情况下,json数据达到100MB左右,仅数据传输时间就需要10-20s左右,简直太慢了。 检索资料看怎么压缩json数据 模拟数据: <?php ini_set('memory_limit', -1); function getTestJson() { 阅读全文
posted @ 2023-11-21 21:32 carol2014 阅读(222) 评论(0) 推荐(0)
摘要: 基础控件 import tkinter as tk from tkinter import ttk def func(): print(input_text.get()) def getCheckButtonVals(): message = "" if hobby1.get() == True: 阅读全文
posted @ 2023-09-11 11:26 carol2014 阅读(27) 评论(0) 推荐(0)
摘要: 模型 模型准确且唯一的描述了数据。它包含您储存的数据的重要字段和行为。一般来说,每一个模型都映射一张数据库表。 每个模型都是一个 Python 的类,这些类继承 django.db.models.Model 模型类的每个属性都相当于一个数据库的字段。 字段 字段类型 AutoField() ID 自 阅读全文
posted @ 2023-09-11 11:13 carol2014 阅读(48) 评论(0) 推荐(0)
摘要: 最近在项目中看到了一段别人写的获取真实IP的代码,特意把这部分的知识记录下,部分内容来源于网络检索,若有侵权请联系我删除。 因为存在IP欺骗和代理问题,所以获取客户端的IP的真实性不能百分百准确。 1、没有使用代理的情况 REMOTE_ADDR = 客户端IP HTTP_X_FORWARDED_FO 阅读全文
posted @ 2023-09-11 09:38 carol2014 阅读(155) 评论(0) 推荐(0)
摘要: 模组 在Python中,一个.py文件就称之为一个模块(Module)。 使用模块可以大大提高代码的可维护性和可复用性。 使用模块还可以避免函数名和变量名冲突。相同名字的函数和变量完全可以分别存在不同的模块中。 自己创建模块时要注意命名,不能和Python自带的模块名称冲突。 " a test mo 阅读全文
posted @ 2023-09-08 17:09 carol2014 阅读(57) 评论(0) 推荐(0)
摘要: os 常用路径操作 import os # 当前 Python 运行所在的环境 posix,nt,java print(os.name) # nt # os.getcwd()获取当前工作路径 print(os.getcwd()) dir = "./files/foo/bar/bar2" file = 阅读全文
posted @ 2023-09-08 17:06 carol2014 阅读(190) 评论(0) 推荐(0)
摘要: Number counter = 100 # 整型变量 miles = 1000.0 # 浮点型变量 num_complex = complex(1.5, 2.5) print(counter) # 100 print(miles) # 1000.0 print(num_complex) # (1. 阅读全文
posted @ 2023-09-08 16:56 carol2014 阅读(28) 评论(0) 推荐(0)
摘要: 脚本最大执行时间、内存限制 ini_set("memory_limit","128M"); // 关闭内存限制 ini_set('memory_limit', '-1'); ini_set('max_execution_time', 30000); // 关闭时间限制 ini_set("max_ex 阅读全文
posted @ 2023-09-01 16:20 carol2014 阅读(23) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 25 下一页