Harbor
Harbor是VMware开源的一个容器镜像仓库;
Harbor is an open source registry that secures artifacts with policies and role-based access control, ensures images ar[……]
Adamhuan's Data Center - 【逻辑驱动数据】
数据玩物、代码屋、1/0游戏:(零和博弈)/ 禅宗意志 / 规则战争 / 解放数据力量 / 技术的飞速发展并没有改变这个世界,因为,这个世界从没有变,它只是越来越趋近于它本来的模样。
Harbor是VMware开源的一个容器镜像仓库;
Harbor is an open source registry that secures artifacts with policies and role-based access control, ensures images ar[……]
ClickHouse / 官方主页:
https://clickhouse.tech/
ClickHouse是俄罗斯的Yandex于2016年开源的列式存储数据库,用于在线分析处理(OLAP),能够使用SQL查询实时生成分析数据报告。
安装与部署:
通过Ansible脚本可以自动化的[……]
代码:
链接:https://pan.baidu.com/s/1TfZ7miVS2cZRPLSeQL_OEw
由于代码中包含了安装介质,容量比较大,所以不放在GitHub上了。
在这个代码中,我会将自己平时用到的部署全部写成一个个的Role,并整合成可以开箱即用的Deploy的YA[……]
上次,写过一个MySQL的操作类:
http://d-prototype.com/archives/13262
但是,上次的代码的问题是被调用的时候还是不够方便,并且数据库的连接信息需要修改代码。
这几天重新写了一版本:
1. 独立成一个类调用
2. 连接信息通过配置文件编辑,不需要修[……]
在使用Python的ConfigParser模块的时候你可能会遇到如题所示的错误。
具体如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
D:\PyCharm_data\venv\Scripts\python.exe D:/PyCharm_data/python_configparser.py Traceback (most recent call last): File "D:/PyCharm_data/python_configparser.py", line 33, in <module> print(get_value_from_file_section_key(file_config,"ALICEWONDER","company_name")) File "D:/PyCharm_data/python_configparser.py", line 22, in get_value_from_file_section_key obj_configParser.read(configFile) File "C:\Users\adamhuan\AppData\Local\Programs\Python\Python37\lib\configparser.py", line 696, in read self._read(fp, filename) File "C:\Users\adamhuan\AppData\Local\Programs\Python\Python37\lib\configparser.py", line 1014, in _read for lineno, line in enumerate(fp, start=1): UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 85: illegal multibyte sequence Process finished with exit code 1 |
我的代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
#!/usr/bin/python # -*- coding: UTF-8 -*- import os import configparser # variable file_config="excel_style.conf" # function # 根据解析文件 | 段 | Key , 获得值 def get_value_from_file_section_key(configFile="",sectionName="",keyName=""): # variable # -- result result = "" # -- ConfigParser obj_configParser = configparser.ConfigParser() # do obj_configParser.read(configFile) result = obj_configParser.get(sectionName,keyName) # return return result # do # 解读配置文件 print(get_value_from_file_section_key(file_config,"ALICEWONDER","company_name")) # done |
文件:excel_style.co[……]