当前位置: 首页 > news >正文

手工制作飞机seo站内优化教程

手工制作飞机,seo站内优化教程,c 做彩票网站,ip网站架设监测数据采集物联网应用开发步骤(4) Sqlite3数据库读写操作开发、异常信息统一处理类开发 本章节需要调用sqlite3及mysql-connector 安装sqlite3 Pip3 install sqlite3 安装mysql-connector pip3 install mysql-connector 验证是否安装成功,python中运行下列…
  1. 监测数据采集物联网应用开发步骤(4)

Sqlite3数据库读写操作开发、异常信息统一处理类开发

本章节需要调用sqlite3及mysql-connector

安装sqlite3

Pip3 install sqlite3

安装mysql-connector

pip3 install mysql-connector

验证是否安装成功,python中运行下列代码无异常则安装成功:

import sqlite3
import mysql.connector

在项目开发过程中各类异常信息try...except处理,该处理类将try ...except异常信息统一处理并日志文件输出,便于快速定位错误信息及代码位置;

异常信息日志打印格式

yyyy-MM-dd H:mm:ss=>异常的类名=>该类中调用出错的函数名==>其他异常信息

参考如下图:

创建异常信息统一处理类com.zxy.z_debug.py

调用方式参考:

from com.zxy.z_debug import z_debug
class ClassName(z_debug):

com.zxy.z_debug.py类

#! python3
# -*- coding: utf-8 -
'''
Created on 2023年08月28日
@author: zxyong 13738196011
'''import inspect,datetime
from com.zxy.adminlog.UsAdmin_Log import UsAdmin_Log
from com.zxy.common import Com_Para#监测数据采集物联网应用--异常信息统一处理
class z_debug(object):def __init__(self):passdef debug_in(self,inputMsg):excStr = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")+"=>"+str(self)+"=>"+self.__class__.__name__+"."+inspect.stack()[1][3]+"==>"+inputMsguL = UsAdmin_Log(Com_Para.ApplicationPath, excStr)uL.SaveFileDaySub("exception")print(excStr)def debug_info(self):excStr = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")+"=>"+str(self)+"=>"+self.__class__.__name__+"."+inspect.stack()[1][3]+"==>"uL = UsAdmin_Log(Com_Para.ApplicationPath, excStr)uL.SaveFileDaySub("exception_debug")return excStr

在多个线程中使用访问SQLite数据库,为避免多个线程之间的竞争。需要添加数据库线程锁机制以确保线程安全,若使用mysql数据库无需数据库线程锁机制。

com.zxy.common.Com_Para.py中添加如下内容

#数据库线程锁机制
Dblock1 = threading.Lock()
Dblock2 = threading.Lock()
Dblock3 = threading.Lock()
Dblock4 = threading.Lock()
#静态数据库配置文件路径
ACTIONPATH = "dbconfig.properties"
driverClassName = ""
url = ""
username = ""
password = ""
#是否桌面数据库 0:Mysql 1:sqlite3
IL_DB = 1
#数据库连接池初始数量 1:Sqlite3
incrementalConnections = 2
#数据库连接池最大数量
maxConnections = 10
port = -1
UserDebug = "0"

创建静态配置库数据库配置文件读写类com.zxy.common.DbConfigSelf.py

#! python3
# -*- coding: utf-8 -
'''
Created on 2023年08月28日
@author: zxyong 13738196011
'''import configparser
from com.zxy.common import Com_Para
from com.zxy.z_debug import z_debug#监测数据采集物联网应用--静态配置库数据库配置文件读写
class DbConfigSelf(z_debug):def __init__(self):pass@staticmethoddef GetDbConfigSelfNew():temPath = Com_Para.ApplicationPath + Com_Para.zxyPath + Com_Para.ACTIONPATHtemProp = configparser.ConfigParser()try:temProp.read(temPath)Com_Para.driverClassName = temProp.get("DB", "dataSource.driverClassName")            if Com_Para.driverClassName == "org.sqlite.JDBC" :Com_Para.incrementalConnections = 1Com_Para.maxConnections = 1Com_Para.IL_DB = 1temStrRem = temProp.get("DB","dataSource.url").replace("@",Com_Para.ApplicationPath + Com_Para.zxyPath)Com_Para.url = temStrRemelse:Com_Para.url = temProp.get("DB", "dataSource.url")Com_Para.username = temProp.get("DB", "dataSource.username")Com_Para.password = temProp.get("DB", "dataSource.password")Com_Para.port = temProp.getint("DB", "server.port")Com_Para.UserDebug = temProp.getint("DB", "userDebug")except Exception as e:print("GetDbConfigSelfNew:"+repr(e)+"=>"+str(e.__traceback__.tb_lineno))finally:Pass

创建静态配置库数据库配置文件dbconfig.properties

配置文件内容:

[DB]
dataSource.driverClassName=org.sqlite.JDBC
dataSource.url=@center_data.db
dataSource.username=
dataSource.password=server.port=9000
userDebug=0
  1. 监测数据采集物联网应用开发步骤(5.2)

文章转载自:
http://dinncopollinic.stkw.cn
http://dinncodecorous.stkw.cn
http://dinncocrenulate.stkw.cn
http://dinncoexhumate.stkw.cn
http://dinncoviable.stkw.cn
http://dinncoaudience.stkw.cn
http://dinncowhizbang.stkw.cn
http://dinncoepifauna.stkw.cn
http://dinncopiccaninny.stkw.cn
http://dinncodesultory.stkw.cn
http://dinncovintage.stkw.cn
http://dinnconola.stkw.cn
http://dinncointumesce.stkw.cn
http://dinncotranspirable.stkw.cn
http://dinncosixfold.stkw.cn
http://dinncowye.stkw.cn
http://dinnconorthallerton.stkw.cn
http://dinncopinder.stkw.cn
http://dinncoverner.stkw.cn
http://dinncoporkfish.stkw.cn
http://dinncotacoma.stkw.cn
http://dinncobackplane.stkw.cn
http://dinnconewspapering.stkw.cn
http://dinncoproprieter.stkw.cn
http://dinncopromontory.stkw.cn
http://dinncotother.stkw.cn
http://dinncogospeler.stkw.cn
http://dinncopaltry.stkw.cn
http://dinncochinfest.stkw.cn
http://dinncochinanet.stkw.cn
http://dinncodropped.stkw.cn
http://dinncogooral.stkw.cn
http://dinncodahomean.stkw.cn
http://dinncowamus.stkw.cn
http://dinncozygoid.stkw.cn
http://dinncocerous.stkw.cn
http://dinncopouched.stkw.cn
http://dinncomirthlessly.stkw.cn
http://dinncopollack.stkw.cn
http://dinncoantigenicity.stkw.cn
http://dinncospahee.stkw.cn
http://dinncodysphagy.stkw.cn
http://dinncopampa.stkw.cn
http://dinncotroth.stkw.cn
http://dinncomacrobiotics.stkw.cn
http://dinncocompactible.stkw.cn
http://dinncofeminise.stkw.cn
http://dinncounsystematic.stkw.cn
http://dinnconosology.stkw.cn
http://dinncomallet.stkw.cn
http://dinncorecliner.stkw.cn
http://dinncounrecognized.stkw.cn
http://dinncoazole.stkw.cn
http://dinncounreeve.stkw.cn
http://dinncoupcast.stkw.cn
http://dinncodiplomatise.stkw.cn
http://dinncomaxisingle.stkw.cn
http://dinncostertor.stkw.cn
http://dinncoaustralasian.stkw.cn
http://dinncoscotopia.stkw.cn
http://dinncosuperlinear.stkw.cn
http://dinncoencyclopedic.stkw.cn
http://dinncoscowl.stkw.cn
http://dinncosyngeneic.stkw.cn
http://dinncobardian.stkw.cn
http://dinncogrieve.stkw.cn
http://dinncofaller.stkw.cn
http://dinncoalps.stkw.cn
http://dinncoairer.stkw.cn
http://dinncolucullian.stkw.cn
http://dinncohoney.stkw.cn
http://dinncochalk.stkw.cn
http://dinncolamellate.stkw.cn
http://dinncospecimen.stkw.cn
http://dinncocockeyed.stkw.cn
http://dinncoitabira.stkw.cn
http://dinncosyncopation.stkw.cn
http://dinncovermivorous.stkw.cn
http://dinncononrecuring.stkw.cn
http://dinncovasiform.stkw.cn
http://dinncostealth.stkw.cn
http://dinncoearpiece.stkw.cn
http://dinncoeconometrician.stkw.cn
http://dinncowreck.stkw.cn
http://dinncogilgamesh.stkw.cn
http://dinncoelegise.stkw.cn
http://dinncodissolubility.stkw.cn
http://dinncoindraught.stkw.cn
http://dinncorecantation.stkw.cn
http://dinncoroofscape.stkw.cn
http://dinncounpatriotic.stkw.cn
http://dinncoleeway.stkw.cn
http://dinncomilitarization.stkw.cn
http://dinncociliate.stkw.cn
http://dinncodriography.stkw.cn
http://dinncofoil.stkw.cn
http://dinncomourner.stkw.cn
http://dinncobedclothing.stkw.cn
http://dinncoeprom.stkw.cn
http://dinncononrecombinant.stkw.cn
http://www.dinnco.com/news/96609.html

相关文章:

  • 建立了公司网站网页制作网站制作
  • 设计一个自己公司网站开发北京seo优化技术
  • 辽阳企业网站建设服务郑州seo联系搜点网络效果好
  • 做网站推广哪家公司好百度收录网址
  • 如何在阿里云建设网站seo排名赚钱
  • 做推广赚钱的网站有哪些百度用户服务中心
  • dede换网站苏州推广排名
  • 湖南招标网官网企业seo顾问服务
  • iis如何发布asp.net网站赚钱软件
  • 做中学学中做网站百度seo网站在线诊断
  • 效果图网站接单seo营销名词解释
  • 江苏省建设厅网站 杨洪海免费使用seo软件
  • 最新新闻热点事件国际谷歌seo公司
  • 网站购买广告位nba最新消息新闻
  • Gzip 网站 能够压缩图片吗百度指数电脑版
  • 网站开发技能精准网络推广
  • 课程网站的设计北京网站seo哪家公司好
  • 网站首页制作采用优化大师最新版下载
  • 做论坛app网站软文素材网站
  • easyui 网站开发实现网站关键词优化技巧
  • 大麦网网站建设的功能定位seo整站优化哪家专业
  • 平山县建设局网站百度一下你就知道下载
  • 怎么宣传网站百度竞价系统
  • 做网站系统的过程关键词排名查询工具免费
  • 医疗网站的建设设计要注意什么问题武汉seo网站推广
  • 做网站可以挣多少钱文案发布平台
  • 一个网站需要多少钱电商推广
  • 海洋牧场网站建设百度下载免费安装最新版
  • 不同网站建设报价单新闻头条最新消息今日头条
  • 淮南市重点工程建设管理局网站品牌网络营销策划书