上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 24 下一页
摘要: 这里使用pymysql模块,PyMySQL 连接 ClickHouse 时需要指定正确的端口号才能成功建立连接,而默认的端口号是 9004 1. 使用 pymysql模块向 clickhouse写数据的时候,占位符 必须都是 "%s" 2.tuple里面,数据类型要强制转为 str 3.record 阅读全文
posted @ 2023-06-07 18:37 He_LiangLiang 阅读(96) 评论(0) 推荐(0) 编辑
摘要: https://clickhouse.com/docs/zh/sql-reference/data-types/int-uint https://www.cnblogs.com/traditional/p/15218628.html https://zhuanlan.zhihu.com/p/5590 阅读全文
posted @ 2023-06-05 11:42 He_LiangLiang 阅读(288) 评论(0) 推荐(0) 编辑
摘要: https://liushilive.github.io/github_exercise_oracle/md/%E6%A6%82%E5%BF%B5/Oracle%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B.html https://docs.oracle.com/en/d 阅读全文
posted @ 2023-06-05 11:30 He_LiangLiang 阅读(33) 评论(0) 推荐(0) 编辑
摘要: https://www.runoob.com/mysql/mysql-data-types.html https://www.w3cschool.cn/mysql/mysql-data-types.html https://www.modb.pro/db/50149 https://www.sjkj 阅读全文
posted @ 2023-06-05 11:05 He_LiangLiang 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 获取日期,时间 使用 datetime 模块 格式化使用 strftime("%Y-%m-%d") strftime("%H:%M:%S") #!/usr/bin/python # -*-coding:utf-8-*- import datetime # 获取当前时间, 其中中包含了year, mo 阅读全文
posted @ 2023-06-02 07:57 He_LiangLiang 阅读(83) 评论(0) 推荐(0) 编辑
摘要: #1.关闭 tafnode ps -ef | grep tafnode /usr/local/app/taf/tafnode/util/stop.sh #2.启动程序gdb /usr/local/app/taf/tafnode/data/HQExtend.StockPoolAlarmServer/b 阅读全文
posted @ 2023-05-30 09:46 He_LiangLiang 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 在linux下面打开某些文件的时候,会在每行后面看到 ^M 这种字符。 解决方案: sed -i 's/\r//g' file1.txt file1.txt 是你有问题的文件。 下面是这个命令的解释: 这个命令的作用是在 `file1.txt` 文件中替换所有的换行符 `\r` 为空字符串。 这个命 阅读全文
posted @ 2023-05-30 09:09 He_LiangLiang 阅读(294) 评论(0) 推荐(0) 编辑
摘要: 计算一段时间内,周六出现的次数。 如果是周六,则 5 == dt_start.weekday() 这里用到了2个主要的日期函数 datetime_to_date_int, date_int_to_datetime import datetime def datetime_to_date_int(dt 阅读全文
posted @ 2023-05-26 22:26 He_LiangLiang 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 一、Ubuntu的默认root密码是随机的,即每次开机都有一个新的root密码。 可以在终端输入命令 sudo passwd 然后输入当前用户的密码,enter. 二、终端会提示输入新的密码并确认,此时的密码就是root新密码。修改成功后, 输入命令 su root 再输入新的密码就ok了。 阅读全文
posted @ 2023-05-18 06:31 He_LiangLiang 阅读(338) 评论(0) 推荐(0) 编辑
摘要: 查看网卡信息: ifconfig -a 使用 nload -m 可以查看设备当前网络带宽情况。 如何查看各个进程的网络带宽呢,可以用到 nethogs 工具。 工具安装 yum install epel-release sudo yum install - y nethogs #执行命令 netho 阅读全文
posted @ 2023-05-09 15:12 He_LiangLiang 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 有时候有些设备限制了网络。我们只能先从其他机器下载rpm文件,然后内网拷贝到其他机器上安装。 # 只下载,不安装。 # downloaddir 是指定下载目录,# nethogs是要下载的工具 yum install --downloadonly --downloaddir=/home/helian 阅读全文
posted @ 2023-05-09 11:06 He_LiangLiang 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 1.使用 nload 工具查看 安装工具 yum install -y epel-release #先安装epel软件库yum install -y nload #再安装nload # 查看所有网卡实时网速 sudo nload -m # 查看指定网卡实时网速 sudo nload eth0 -m 阅读全文
posted @ 2023-05-09 09:53 He_LiangLiang 阅读(3742) 评论(0) 推荐(1) 编辑
摘要: 三种方法: 1、在 Python 中使用 pickle 模块的 dump 函数将字典保存到文件中import pickle my_dict = { 'Apple': 4, 'Banana': 2, 'Orange': 6, 'Grapes': 11}# 保存文件with open("myDictio 阅读全文
posted @ 2023-04-20 17:09 He_LiangLiang 阅读(552) 评论(0) 推荐(0) 编辑
摘要: ########### 删除某个 clickhouse 表 drop table db_center.QT_PLATE_VAL_INFO_EX_LYR ########### 创建表 CREATE TABLE db_center.QT_PLATE_VAL_INFO_EX_LYR ( `PLATE_U 阅读全文
posted @ 2023-04-13 18:49 He_LiangLiang 阅读(557) 评论(0) 推荐(0) 编辑
摘要: 在Python中,可以直接使用 内置函数 str(),将字典/列表 转换为 json 字符串 dicta = {"name":"henry","age":32} lista = ["aa","bb","cc","dd"] listb = [1,2,3,4,5,6,7,100,200,30,40] a 阅读全文
posted @ 2023-04-12 11:00 He_LiangLiang 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 创建一个test.json的文件 { "test": "测试\n换行", "dict": { "list": [0, "str\""], "num": 0 } } json 格式编写: json 格式大致以 python 的 dict {} 格式来编写即可,只是要注意字符串不能用单引号' ',一定要 阅读全文
posted @ 2023-04-12 10:48 He_LiangLiang 阅读(494) 评论(0) 推荐(0) 编辑
摘要: 基础 浮点数是用机器上浮点数的本机双精度(64 bit)表示的。提供大约17位的精度和范围从-308到308的指数。和C语言里面的double类型相同。Python不支持32bit的单精度浮点数。如果程序需要精确控制区间和数字精度,可以考虑使用numpy扩展库。 Python 3.X对于浮点数默认的 阅读全文
posted @ 2023-04-12 10:42 He_LiangLiang 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 解决方法 dict的get("key", 0)方法不要添加default=,删除这个写法并不影响使用逻辑,但是加上会导致报错。 d = { 'key': 2, } print(d.get("key", 0)) 问题解析 如果使用下面的代码就会报错TypeError: get() takes no k 阅读全文
posted @ 2023-04-12 10:41 He_LiangLiang 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 当我在一次写下如下代码时,报错AttributeError: 'dict' object has no attribute 'has_key': if not my_dict.has_key(my_key): 当时真的是一脸懵逼,我在Python2的时候一直这样写的,为什么会错呢? 后来经过查询文档 阅读全文
posted @ 2023-04-11 18:16 He_LiangLiang 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 这里展示的oracle,mysql, clickhouse 下面如何创建一个表的DDL语句。 请注意这里的数据类型,在不同的表,表示形式不一样。 Oracle 的DDL语句 -- UPCENTER.PUB_PLATE_INFO definition CREATE TABLE "UPCENTER"." 阅读全文
posted @ 2023-04-07 18:04 He_LiangLiang 阅读(112) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 24 下一页