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

搭建网站 软件wordpress添加微信扫码支付宝

搭建网站 软件,wordpress添加微信扫码支付宝,网络舆情监测预警系统,旅游营销网站开发监测数据采集物联网应用开发步骤(2) 系统整体结构搭建 新建项目 输入项目名称:MonitorData 所谓兵马未动粮草先行,按下图创建好对应的模块备用: com.plugins 业务插件模块 com.zxy.adminlog 日志或文本文…
  1. 监测数据采集物联网应用开发步骤(2)

系统整体结构搭建

新建项目

输入项目名称:MonitorData

所谓兵马未动粮草先行,按下图创建好对应的模块备用:

com.plugins                     业务插件模块

com.zxy.adminlog            日志或文本文件读写模块

com.zxy.autoUpdate       程序版本自动更新模块

com.zxy.business             通用业务处理模块

com.zxy.common            通用函数模块

com.zxy.comport             串口通讯模块

com.zxy.db_Self               静态接口配置库(Sqlit3)模块

com.zxy.db1                     静态接口配置库(Sqlit3)模块

com.zxy.db2                     业务数据库(Sqlite3)模块

com.zxy.interfaceReflect         通用插件管理模块

com.zxy.main                   全局变量初始化模块

com.zxy.taskhandler        定时器任务模块

com.zxy.tcp                      tcp协议模块

编写主程序代码MonitorDataCmd.py,打印启动时间,sleep 5秒,然后打印结束时间

#! python3
# -*- coding: utf-8 -
'''
Created on 2023年08月28日
@author: zxyong 13738196011
'''import time
from com.zxy.common.Com_Fun import Com_Fun#监测数据采集物联网应用-主程序
class MonitorDataCmd(object):def __init__(self, params):passif __name__ == '__main__':print("监测数据采集物联网应用软件开始:"+Com_Fun.GetTimeDef())time.sleep(5)print("监测数据采集物联网应用软件结束:"+Com_Fun.GetTimeDef())

新建通用函数代码com.zxy.common.Com_Fun.py

#! python3
# -*- coding: utf-8 -
'''
Created on 2023年08月28日
@author: zxyong 13738196011
'''import datetime,uuid,time
from datetime import timedelta#监测数据采集物联网应用--通用函数
class Com_Fun():def __init__(self):pass@staticmethoddef NoNull(objTag):if objTag is None:return ""else:return str(objTag)@staticmethoddef FloatNull(objTag):if objTag is None or objTag == "" or objTag == "-":return 0else:return float(objTag)@staticmethoddef ZeroNull(objTag):if objTag is None or objTag == "":return 0else:return int(objTag)@staticmethoddef GetLong(inputTimeFormat,inputTime):if len(inputTime) > 19:inputTime = inputTime[0:19]time1=datetime.datetime.strptime(inputTime.replace("T"," "),inputTimeFormat)return time.mktime(time1.timetuple())#获得当前时间戳@staticmethoddef getTimeLong():temT = datetime.datetime.now()timeStamp = time.mktime(temT.timetuple())return timeStamp#日期信息格式化timeFormat : '%Y-%m-%d %H:%M:%S'@staticmethoddef GetTime(inputTimeFormat):return datetime.datetime.now().strftime(inputTimeFormat)#日期信息格式化秒数据10整数化@staticmethoddef GetTimeNum(inputTime):temTime = datetime.datetime.strptime(inputTime.replace("T", " "),"%Y-%m-%d %H:%M:%S")temSB = temTime.strftime("%Y-%m-%d %H:%M")temSE = temTime.strftime("%S")temSec = int(int(temSE) / 10)return temSB+":"+str(temSec)+"0"#日期信息格式化timeFormat : '%Y-%m-%d %H:%M:%S'@staticmethoddef GetTimeDef():return str(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))#日期信息格式化timeFormat : '%Y-%m-%d %H:%M:%S' 字符串@staticmethoddef GetTimeInput(inputTimeFormat,inputTime):if inputTime is None or inputTime == "":return "1900-01-01 00:00:00"time1=datetime.datetime.strptime(inputTime.replace("T", " "),inputTimeFormat)return time1#日期信息格式化timeFormat : '%Y-%m-%d %H:%M:%S' 字符串@staticmethoddef GetStrTimeInput(inputTimeFormat,inputTime):if inputTime is None or inputTime == "":return "1900-01-01 00:00:00"time1=datetime.datetime.strptime(inputTime.replace("T", " "),inputTimeFormat)return str(time1)#返回time格式@staticmethoddef GetToTimeInput(inputTimeFormat,inputTime):if inputTime is None or inputTime == "":return "1900-01-01 00:00:00"elif len(inputTime) <= 19:return datetime.datetime.strptime(inputTime.replace("T"," "),inputTimeFormat)else:return datetime.datetime.strptime(inputTime[0:19],inputTimeFormat)#日期信息格式化timeFormat : '%Y-%m-%d %H:%M:%S',返回字符串格式@staticmethoddef GetDateInput(inputDateFormat,inputTimeFormat,inputTime):if len(inputTime) < 10 or inputTime is None or  inputTime == "":return "1900-01-01"time1=datetime.datetime.strptime(inputTime.replace("T"," "),inputTimeFormat)return time1.strftime(inputDateFormat)#(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)@staticmethoddef DateTimeAdd(inputDate,inputDateType,inputNum):#%d %H:%M:%Sdelta = Noneif inputDateType == "d":delta = timedelta(days=inputNum)elif inputDateType == "W":delta = timedelta(weeks=inputNum)elif inputDateType == "H":delta = timedelta(hours=inputNum)elif inputDateType == "M":delta = timedelta(minutes=inputNum)elif inputDateType == "S":delta = timedelta(seconds=inputNum)return inputDate + delta@staticmethoddef SetHashTable(inputHt,inputStrKey,inputStrValue):if inputHt is None:inputHt = {}inputHt[inputStrKey] = inputStrValue@staticmethoddef GetHashTable(inputHt,inputStrKey):if inputHt is None or inputStrKey not in list(inputHt.keys()):return ""else:return inputHt[inputStrKey]@staticmethoddef GetHashTableNone(inputHt,inputStrKey):if inputHt is None or inputStrKey not in list(inputHt.keys()):return Noneelse:return inputHt[inputStrKey]@staticmethoddef RemoveHashTable(inputHt,inputStrKey):if inputHt.get(inputStrKey) is not None:inputHt.pop(inputStrKey)@staticmethoddef Str_To_Int(inputStr):if inputStr is not None and inputStr != "":return int(inputStr)else:return 0@staticmethoddef Get_New_GUID():return str(uuid.uuid1()).upper()

运行程序,选择主程序右键:

程序执行结果:

恭喜你!系统整体结构搭建完成。

  1. 监测数据采集物联网应用开发步骤(4)
http://www.yayakq.cn/news/215156/

相关文章:

  • 在哪里建网站好设计网站的公司名称
  • 邢台seo一站式国家企业信用信息没有网站怎么做
  • 中国城乡住房和建设部网站首页使用代理服务器后看什么网站
  • 广州域名企业网站建站哪家好广州网站开发哪家公司好
  • 昆山做网站公司哪家好wordpress媒体库的目录错误
  • 彩票网站建设哪里高端建材项目
  • 教育培训网站设计怎么制作自己的二维码
  • 网站建设行业赚钱么上海学校网站建设
  • 深圳建模板网站一个前端页面多少钱
  • 微网站免费模板跨境电商平台有哪些可以加盟
  • 一个考试网站怎么做搜索网站内容
  • 一起做英语作业网站黄石手机网站建设
  • 中信建设有限责任公司官方网站跨境电商erp软件排名
  • seo网站营销分销系统方案
  • 网站开发细节怎么做才能使网站ip增多
  • 网站建设工资一月多少网站备案快速备案
  • 公众电影网站怎么做纯文本网站建设
  • 济南网站建设李尚荣网站风格一般具有哪三大特征
  • 长沙网站主机北京住房和城乡建设部网站
  • 潍坊住房和城乡建设局网站南通网站建设规划书
  • 东莞整站排名查企业免费
  • wordpress ftp免密码做搜狗网站优化点击软
  • 网站建设与维护实训ppt软件开发培训机构培训出来的
  • 企业建站一条龙聚财的公司名字
  • 营销型网站建设推荐网络公司网站样本
  • 建设信源网站苏州培训网站建设
  • 一加手机官网网站百度个人网站建设
  • 如何利用网站做产品推广易尔通网站建设
  • 建设网站虚拟主机是啥意思网站建设评审
  • 友链对网站seo有帮助吗深圳宝安区西乡街道