
开发
Neil_001
这个作者很懒,什么都没留下…
展开
-
python 正则表达式 正向反向肯定否定
【代码】python 正则表达式 正向反向肯定否定。原创 2022-12-13 23:04:49 · 395 阅读 · 1 评论 -
python 包安装及下载
python 第三方依赖包下载及安装方法原创 2022-06-13 17:44:03 · 430 阅读 · 0 评论 -
win 打开环境变量快捷方式
win + r输入 systempropertiesadvanced 回车原创 2022-03-05 11:14:00 · 705 阅读 · 0 评论 -
python pyinstaller打包及缺失dll文件及相关库解决方案
一、pyinstaller打包步骤(1) pip install pyinstaller安装成可执行文件(2) pyinstaller -F main.py 执行打包动作,生成可执行程序至dist目录二、如果可执行程序执行报缺少xxx.dll文件解决方式如下:(1) 在python安装目录下的lib/site-packages目录中找到相关的xxx.dll文件,(2) 将xxx.dll文件拷贝到dist生成的可执行文件目录中(3) 修改main.py同目录中的main.spec文原创 2021-11-03 22:57:20 · 14329 阅读 · 1 评论 -
win10 系统path环境太大,变量最长2047个字符
现象: 在path变量中增加or修改系统环境变量,弹出最长2047个字符解决:1. win+r : regedit2. 计算机\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment3. 双击path,直接修改数值数据,保存后直接生效。...原创 2021-08-25 09:46:43 · 1134 阅读 · 0 评论 -
idea 设置模板快捷输入固定格式样本
现象: 需求在idea打开的代码页, 输入read,自动插入带时间的注释方法:file -> settings -> editor -> livetemplates -> + -> live template (live groups):1. abbr: read2. description: shortcut for insert date time comments3. template text: // read time: %date%4. edit原创 2021-08-25 09:40:02 · 209 阅读 · 0 评论 -
maven 解决idea依赖插件报红问题
方法:命令行执行: mvn dependency:get -DrepoUrl=http://repo.maven.apache.org/maven2/ -Dartifact=<groupId>:<artifactId>:<version>拉下相关的依赖插件例如:mvn dependency:get -DrepoUrl=http://repo.maven.apache.org/maven2/ -Dartifact=org.apache.maven.plugins原创 2021-08-22 11:06:28 · 544 阅读 · 0 评论 -
win10 tortoiseGit 图标不显示或显示不全问题
1. 鼠标右击打开tortoiseGit settings页面,点击Start Register Edit2. 在弹出的注册表中把Tortoise的每一项前面多加几个空格,排序会靠前。如果出现有些功能如新建文件和添加等显示的是同一个图标,在ShellIconOverlayIdentifiers上右击导出保存备份reg文件,再把注册表中无用的shellIcon都删掉,如OneDriver...,aWeCloudDriver等。3. Status Cache选择shell4. 启动任务管原创 2020-06-29 19:26:06 · 2312 阅读 · 0 评论 -
java idea spring mybatis找不到bean报红
settings->inspections->spring->spring core->autowiring for bean class原创 2020-06-28 22:49:33 · 988 阅读 · 0 评论 -
windows 生成ssh
1. 使用git bash 进入当前用户目录2. ssh-keygen -t rsa -C 'xxx@qq.com'3. 一路回车原创 2020-06-27 14:47:26 · 353 阅读 · 0 评论 -
python 最简单的服务
Python2:python2 -m SimpleHTTPServer <port>Python3:python3 -m http.server <port>原创 2020-05-05 23:54:11 · 343 阅读 · 0 评论 -
python 执行shell脚本
python脚本中执行 shell脚本# os.system# winos.system('dir');# linuxos.system('ls -l');# subprocess.run/call#winsubprocess.run('python -m http.server')subprocess.call('python -m http.server')...原创 2020-05-05 23:52:59 · 396 阅读 · 0 评论 -
python ModuleNotFoundError
脚本开头设置路径,避免本地module找不到不能导入# -*- coding: utf-8 -*-import sysimport osmodule_path = os.path.dirname(os.path.abspath(__file__)) # 上级目录sys.path.append(module_path)...原创 2020-05-05 23:42:34 · 263 阅读 · 0 评论 -
python virtualenv 创建本地虚拟环境
1. pycharmNew Project -> Pure Python -> Project Interpreter: New Virtual environment1) 打开cmd:进入venv目录->activate激活, deactivate退出虚拟环境。2) pycharm打开控制台直接激活虚拟环境2.命令行方式pip install vi...原创 2020-04-06 11:39:27 · 434 阅读 · 0 评论 -
java 泛型
1.用法在容器后添加<Type>,Type可以为类、抽象类、接口。表明容器只能存入Type类或其子类的对象。2.设计支持泛型的类,使用<T>表示代型。public class SelfDefineStack<T>{ LinkedList<T> ll = new LinkedList<T>();}2.通配...原创 2020-04-05 01:13:49 · 188 阅读 · 0 评论 -
java 集合框架 容器
一、ArrayList顺序结构1. ArrayList数组申请固定长度之后,未使用的属于浪费。为了解决数组的局限性,引入容器类。如ArrayList.容量capacity会随着元素增加自动增加,不用考虑边界问题。@SupressWarnings("rawtypes")ArrayList mans = new ArrayList();mans.add(new Man()...原创 2020-04-05 00:55:11 · 243 阅读 · 0 评论 -
java 文件处理
1.文件对象import java.io.File;File f1 = new File('./hello.txt');f1.getAbsolutePath(); //绝对路径File f2 = new File("E:/");File f3 = new File(f2, "world.txt"); //f2作为父目录创建world.txt对象f1.exists();f1...原创 2020-04-05 00:55:57 · 340 阅读 · 0 评论 -
java 异常
异常:程序的正常流程被中断的事件。try...catch...finally...throw...throws(方法定义时使用)try{ ...}catch (Throwable t){ t.printStackTrace();}class SelfDefineEx extends Exception{ public SelfDefineEx(){...原创 2020-04-05 00:56:09 · 167 阅读 · 0 评论 -
java 日期
1. java.util.Date数字0表示1970.01.01 08:00:00.中国和格林威治时间相差8小时,时区为UTC-8。每过1毫秒,数字加1。(1969年发布第1个unix)2.使用Date d1 = new Date();Date d2 = new Date(3600);获取当前时间: d1.getTime();与System.currentTimeMillis...原创 2020-04-05 00:55:39 · 283 阅读 · 0 评论 -
java 数字与字符串
1.封装类、装箱、拆箱封装类:基本类型对应的类类型Number类的子类有Byte, Short, Integer, Long, Float, Double基本类型->封装类: int i = 1; Integer intVal = new Integer(i),自动装箱: Integer intVal = i;封装类型—>基本类型: int i = intVal....原创 2020-04-04 19:05:04 · 278 阅读 · 0 评论 -
java 接口与继承
1.接口作为一种约定,约定某些类必须有接口中定义的方法,方法在类中重写实现。接口定义与类相似,把class换成 interface。但是接口中没有属性,只有空方法(没有方法体)。public interface A{ public void aHello(); // 空方法}public interface B{ public void bHello(); ...原创 2020-04-04 18:26:38 · 201 阅读 · 0 评论 -
java 类和对象
1.引用变量的类型是类类型,不是基本类型,也叫引用。A a = new A();a引用(指向) 右则创建的对象。A a1 = a;A a2 = a;a1,a2和a均指向同一个对象。A a = new A(); a = new A();此时a指向另一个A类型对象,第一次创建的A()对象不再可以访问。2.继承(extends)继承父母的属性和成员函数...原创 2020-04-04 15:31:45 · 189 阅读 · 0 评论 -
java 数组
1.声明 int[] a, int a[],2. 赋值:1)分步int[] a;赋值:a = new int[5]; //a引用此数组a[0]=0; a[1]=1;2)分配空间时同时赋值,此时不可设置数组长度,否则会使分配空间长度和赋值的内容长度不一致int[] a = new int[] {0, 1, 2, 3, 4}int[] a = {0, 1,...原创 2020-04-04 08:06:49 · 175 阅读 · 0 评论 -
java 操作符
1.逻辑操作符&&:短路与,只要左边为false,右边不会再运算&:长路与,左边为false,右边也会运算||与|类似.2.位操作符位操作都是对二进制进行的。Integer.toBinaryString():将整数转为二进制字符串操作符: &, |, ^, ~, <<, >>, >>&...原创 2020-04-04 07:43:17 · 224 阅读 · 1 评论 -
java 变量及命名规范
1.只能使用:字母、数字、$、下划线_,不能以数字开头2.尽可能使用完整的单词,驼峰式命名3.关键字类型 枚举 异常 try, catch, finally, throw, throws 对象 new, extends, implements, class, instanceof, this, super 字面值 false, true, n...原创 2020-04-04 07:20:42 · 798 阅读 · 0 评论 -
java 字面值、数据类型转换
1.基本类型变量整型:byte, short, int, long字符型: char浮点型: float/double布尔型: boolean2.字面值基本类型是java语言内置的特殊数据类型,赋值的方式为字面值,不需要像类的对象创建一样使用new;类的对象需要new。3.不同数据类型之间相互转换short和char都是16位,长度一致,也需强制转换:...原创 2020-04-04 06:50:52 · 338 阅读 · 0 评论 -
java 常用数据类型
常用数据类型类型 默认值 长度 范围 使用说明 byte 0 8 -128~127 short 0 16 -32768~32767 int 0 32 -2147483648~2147483647 long 0 64 -92233720368547...原创 2020-04-04 02:54:42 · 185 阅读 · 0 评论 -
shell 编程 (12)函数
格式:[function] fun(){ action; [return int;]}eg:[root@k8s-master test7]# cat t0.sh #!/bin/bashfun() { echo 'helloworld'}echo 'start...'funecho 'end...'[root@k8s-master test7]#...原创 2020-03-21 02:53:16 · 165 阅读 · 0 评论 -
shell 编程 (11)流程控制
sh脚本的流程控制不可为空,如else后如果没有需要执行的语句,则不要写else1. if-else# 适用于脚本形式if conditionthen command1 command2 ... commandnfi# ---------------------if condition1then command1elif condition2then...原创 2020-03-21 02:40:59 · 201 阅读 · 0 评论 -
shell 编程 (10)test
test命令用于检查某条件是否成立,适用于数值、字符串、文件。数值:-eq:等于为true-ne:不等于为true-gt:大于为true-lt:小于为true-ge:大于等于为true-le:小于等于为true[]中执行基本算述运算字符串:=:等于为true!=:不等于为true-n:不为0为true-z:为0为true文...原创 2020-03-21 02:02:13 · 208 阅读 · 0 评论 -
shell 编程 (9)printf
仿C程序的printf()程序printf format-string [arguments...]format-string用双引号或单引号括起来,如果只有1个输出可不用引号printf需手动添加\n才能起到换行效果。echo会自动添加换行符。%-ns:宽度为n个字符,-左对齐,否则右对齐,不足用空格,超过全部显示%m.nf:整数m位,小数n位。%d:整数无对应参数%...原创 2020-03-21 01:49:46 · 200 阅读 · 0 评论 -
shell 编程 (8)重定向
cmd > file:输出重定向到文件cmd < file:输入重定向到文件cmd >>file:输出追加重定向到文件n > file:将文件描述符为n的文件重定向到filen >> file:描述符为n的文件追加重定向到filen >$ m:输出文件m和n合并到mn <$ m:输入文件m合并到n...原创 2020-03-21 01:34:43 · 188 阅读 · 0 评论 -
shell 编程 (7)文件包含
在一个sh脚本中执行另一个sh脚本使用:. ./t0.shsource ./t0.sh中间有一空格eg:[root@k8s-master test3]# ll总用量 8-rw-r--r--. 1 root root 28 3月 21 01:15 t0.sh-rw-r--r--. 1 root root 60 3月 21 01:16 t2.sh[root@k8s...原创 2020-03-21 01:18:20 · 153 阅读 · 0 评论 -
shell 编程 (6)echo read -e \n \c 重定向
echo str1.显示普通字符串echo "str"可不带""双引号可转义\"str\"eg:[root@k8s-master test2]# echo strstr[root@k8s-master test2]# echo "str"str[root@k8s-master test2]# echo \"str\""str"[root@k8s-master...原创 2020-03-21 01:03:53 · 904 阅读 · 0 评论 -
shell 编程 (5)基本运算符
一、算术运算1. expr支持算术运算使用反引号``,表达式与运算符之间必须有空格。`expr 2 + 3`中的2、3与+之间必须有空格。[root@k8s-master ~]# val=`expr 2 + 3`[root@k8s-master ~]# echo $val5+:加-:减*:乘 (符号前必须加转义符反余杠/)/:除%:取余=:赋值==...原创 2020-03-21 00:48:20 · 303 阅读 · 0 评论 -
shell 编程 (4)传参
向脚本传递参数:./script_name.sh var0 var1 var2脚本内取参:$0:文件名$1:第1个参数$2:第2个参数[root@k8s-master test0]# cat test8.sh #!/bin/bashecho "params:"echo "script name: $0";echo "first param: $1";...原创 2020-03-20 01:26:25 · 198 阅读 · 0 评论 -
shell 编程 (3)注释
1. 使用#进行单行注释。2. 将要注释的代码块放在函数中,没有地方调用此函数,达到相同效果。3.:<<EOFXXXEOF其中EOF可换成其他字符(不能用单引号)。[root@k8s-master test0]# sh test7.sh startsecondtest7.sh:行25: 警告:立即文档在第 22 行被文件结束符分隔 (需要 `...原创 2020-03-20 01:10:55 · 1079 阅读 · 0 评论 -
shell 编程 (2) 数组
数组:只支持一维,不限定大小。下标由0开始,可以是整数或算数表达式,大于或等于0。1.定义数组arr_name=(val0, val1, ..., valn)arr_name=(val00val11)arr_name[n]=valuen下标可以不连续。[root@k8s-master test0]# arr_name=(val0, val1, val...原创 2020-03-20 00:59:53 · 168 阅读 · 0 评论 -
shell 编程 (1)简单使用
1. helloworld(1)作为可执行程序第1行指定解释器信息:#!/bin/bash(2)作为解释器参数,直接运行解释器,参数为shell脚本文件名eg: /bin/sh test.sh[root@k8s-master test0]# sh test.sh Hello World![root@k8s-master test0]# chmod +x ./test...原创 2020-03-20 00:49:21 · 207 阅读 · 0 评论 -
centos 网络工具
yum install tcpdump:截获数据包yum install traceroute: 路由跳数tcpdump -i ens33 icmp and src host "192.168.159.132" -nn原创 2020-03-16 02:10:56 · 193 阅读 · 0 评论