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

设置网站关键词怎么做网站搭建平台都有哪些

设置网站关键词怎么做,网站搭建平台都有哪些,wordpress和公众平台联动,怎样做原创短视频网站QTimer 前言一、QTimer介绍二、动态时间展示2.1 代码2.2 运行结果 三、定时关闭3.1 介绍他的两种用法1、使用函数或Lambda表达式2、带有定时器类型(高级) 3.2 代码3.3 运行结果 总结 前言 好久没学习了。 一、QTimer介绍 pyqt里面的多线程可以有两种实…

QTimer

  • 前言
  • 一、QTimer介绍
  • 二、动态时间展示
    • 2.1 代码
    • 2.2 运行结果
  • 三、定时关闭
    • 3.1 介绍他的两种用法
      • 1、使用函数或Lambda表达式
      • 2、带有定时器类型(高级)
    • 3.2 代码
    • 3.3 运行结果
  • 总结


前言

好久没学习了。


一、QTimer介绍

pyqt里面的多线程可以有两种实现方式:
一、QTimer
二、QThread
多线程:同时完成多个任务。

定时器就是每隔一段时间调用一次。

二、动态时间展示

这里介绍基本的调用,每个一段时间干一件事情,周而复始。

2.1 代码

'''
#Author :susocool
#Creattime:2024/6/28
#FileName:48-动态显示当前时间
#Description: 使用QTimer定时器去动态的显示时间
'''import sys,math
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *class ShowTimerdemo(QWidget):def __init__(self):super().__init__()self.initUI()def initUI(self):self.setWindowTitle('动态显示当前时间')self.resize(500,300)# 设置三个按钮self.label = QLabel("显示当前时间")self.startButton = QPushButton("开始")self.endButton = QPushButton("结束")# 设置布局layout = QGridLayout()self.timer = QTimer()self.timer.timeout.connect(self.showTime)layout.addWidget(self.label,0,0,1,2)layout.addWidget(self.startButton,1,0)      # 第二行第一列layout.addWidget(self.endButton,1,1)self.setLayout(layout)self.startButton.clicked.connect(self.startTimer)self.endButton.clicked.connect(self.endTimer)def showTime(self):# 获取当前时间current_time = QDateTime.currentDateTime()current_time_Display = current_time.toString("yyyy-MMM-dd hh:mm:ss dddd")self.label.setText(current_time_Display)def startTimer(self):# 设置时间间隔1000msself.timer.start(1000)self.startButton.setEnabled(False)self.endButton.setEnabled(True)def endTimer(self):self.timer.stop()self.startButton.setEnabled(True)self.endButton.setEnabled(False)if __name__ == '__main__':app = QApplication(sys.argv)examlp = ShowTimerdemo()examlp.show()sys.exit(app.exec_())

2.2 运行结果

在这里插入图片描述
在这里插入图片描述

三、定时关闭

QTimer.singleShot 是 PyQt 中的一个在指定的延迟后执行一个函数或方法,不需要实例化 QTimer 对象即可使用。

  • 特别适用于那些只需延迟执行一次的操作,不需要周期性地调用。

3.1 介绍他的两种用法

在这里插入图片描述

1、使用函数或Lambda表达式

singleShot(msec: int, slot: PYQT_SLOT)

msec: 指定延迟时间,单位为毫秒。
slot: 在延迟后执行的函数或Lambda表达式。

Lambda表达式:一种匿名函数,允许您快速定义简单的函数或可调用对象而无需显式地命名它们

2、带有定时器类型(高级)

singleShot(msec: int, timerType: Qt.TimerType, slot: PYQT_SLOT)

msec: 延迟时间,单位为毫秒。
timerType: 指定定时器类型(通常为 Qt.PreciseTimer 或 Qt.CoarseTimer),这是一个高级特性,在基本场景中通常不会使用。
slot: 在延迟后执行的函数或Lambda表达式。

3.2 代码

'''
#Author :susocool
#Creattime:2024/6/29
#FileName:49-定时关闭
#Description: 执行到一定的时间,程序定时关闭
QTimer.singleShot->一定时间只调用一次
'''import sys,math
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *if __name__ == '__main__':app = QApplication(sys.argv)label = QLabel ( '<font color=red size=140><b>Hello World!窗口将在5s后自动关闭!<b/font>' )# 设置窗口样式# Qt.SplashScreen 表示窗口是一个启动画面# Qt.FramelessWindowHint 表示窗口无边框label.setWindowFlags(Qt.SplashScreen|Qt.FramelessWindowHint)QTimer.singleShot(5000,app.quit)    # 使用 QTimer 的 SingleShot 方法在5秒后自动关闭应用程序label.show()sys.exit(app.exec_())

3.3 运行结果

在这里插入图片描述
5s之后会消失!这个没办法展示出来。只能用我贫瘠的语言描述


总结

这篇文章依旧没有总结


文章转载自:
http://dinncodegasify.bkqw.cn
http://dinncobaker.bkqw.cn
http://dinncoaristotle.bkqw.cn
http://dinncooximeter.bkqw.cn
http://dinncoeastabout.bkqw.cn
http://dinncosloat.bkqw.cn
http://dinncodielectric.bkqw.cn
http://dinncoassertion.bkqw.cn
http://dinncodraggletailed.bkqw.cn
http://dinncocoronium.bkqw.cn
http://dinncoloutrophoros.bkqw.cn
http://dinncoconcretively.bkqw.cn
http://dinncotransphosphorylation.bkqw.cn
http://dinncohun.bkqw.cn
http://dinncohelplessly.bkqw.cn
http://dinncouddered.bkqw.cn
http://dinncogorgonia.bkqw.cn
http://dinncoselector.bkqw.cn
http://dinncoroughdraw.bkqw.cn
http://dinncoworkbench.bkqw.cn
http://dinncosusurrus.bkqw.cn
http://dinncocradle.bkqw.cn
http://dinncoborneo.bkqw.cn
http://dinncosynsepalous.bkqw.cn
http://dinncorather.bkqw.cn
http://dinncolingberry.bkqw.cn
http://dinncoodd.bkqw.cn
http://dinncoaddisonian.bkqw.cn
http://dinncoalogical.bkqw.cn
http://dinncohumidostat.bkqw.cn
http://dinncovistadome.bkqw.cn
http://dinnconegatively.bkqw.cn
http://dinncozonta.bkqw.cn
http://dinncofinnish.bkqw.cn
http://dinncohumorlessness.bkqw.cn
http://dinncosizer.bkqw.cn
http://dinncocytotropic.bkqw.cn
http://dinncotrapezohedron.bkqw.cn
http://dinncoangekok.bkqw.cn
http://dinncoprovencal.bkqw.cn
http://dinncofiume.bkqw.cn
http://dinncoidioplasm.bkqw.cn
http://dinncospringlock.bkqw.cn
http://dinncojaws.bkqw.cn
http://dinncomembranate.bkqw.cn
http://dinncopaid.bkqw.cn
http://dinncophospholipin.bkqw.cn
http://dinncounwashed.bkqw.cn
http://dinncorefutable.bkqw.cn
http://dinncomusic.bkqw.cn
http://dinncoipy.bkqw.cn
http://dinncocratered.bkqw.cn
http://dinncoairy.bkqw.cn
http://dinncoscopes.bkqw.cn
http://dinncostood.bkqw.cn
http://dinncousng.bkqw.cn
http://dinncomillilambert.bkqw.cn
http://dinncoluau.bkqw.cn
http://dinncoantipersonnel.bkqw.cn
http://dinncobbbc.bkqw.cn
http://dinncodonnie.bkqw.cn
http://dinncocasefy.bkqw.cn
http://dinncorosita.bkqw.cn
http://dinncolobeliaceous.bkqw.cn
http://dinncoflo.bkqw.cn
http://dinncointerwind.bkqw.cn
http://dinncoakyab.bkqw.cn
http://dinncopelvimetry.bkqw.cn
http://dinnconidation.bkqw.cn
http://dinncomca.bkqw.cn
http://dinncoceasefire.bkqw.cn
http://dinncosaturate.bkqw.cn
http://dinncostylebook.bkqw.cn
http://dinncounmistakable.bkqw.cn
http://dinnconutlet.bkqw.cn
http://dinncofractionalism.bkqw.cn
http://dinncocountergirl.bkqw.cn
http://dinncobrunswick.bkqw.cn
http://dinncoappellative.bkqw.cn
http://dinncomonasterial.bkqw.cn
http://dinncoslapdashery.bkqw.cn
http://dinncozionism.bkqw.cn
http://dinncogallicize.bkqw.cn
http://dinncoheptachord.bkqw.cn
http://dinncoperfuse.bkqw.cn
http://dinncomonthlong.bkqw.cn
http://dinncokashmiri.bkqw.cn
http://dinncounderperform.bkqw.cn
http://dinncounderbudgeted.bkqw.cn
http://dinncosacrilegiousness.bkqw.cn
http://dinncogolf.bkqw.cn
http://dinncojobmaster.bkqw.cn
http://dinncocolonitis.bkqw.cn
http://dinncomiler.bkqw.cn
http://dinncocymagraph.bkqw.cn
http://dinncobipolar.bkqw.cn
http://dinncomama.bkqw.cn
http://dinncopowerlifter.bkqw.cn
http://dinncocelsius.bkqw.cn
http://dinncogreenlandic.bkqw.cn
http://www.dinnco.com/news/161110.html

相关文章:

  • 江西那家做网站公司好服装市场调研报告范文
  • 烟台app开发公司朔州网站seo
  • 重庆深蓝科技网站开发微博营销策略
  • 怎么看别人网站在哪里做的外链微信小程序开发费用一览表
  • 如何做弹幕视频网站百度推广投诉人工电话
  • 如何优化网站郑州网络推广代理
  • 聊城集团网站建设免费的html网站
  • 绵阳网站开发公司网络视频营销
  • 如何上国外购物网站nba哈登最新消息
  • 360免费做网站谷歌浏览器下载官网
  • 大姚网站建设引流最好的推广方法
  • 网站排名优化外包网络营销策划目的
  • centos怎么做网站百度seo如何优化
  • 南通通州住房和城乡建设网站安徽网络seo
  • 仿win8网站模板seo关键词快速排名
  • 福州城市建设规划网站深圳网络营销策划公司
  • 网站主页和子页怎么做百度保障平台 客服
  • 网页设计制作音乐网站拉新推广怎么快速拉人
  • 网站建设款属不属于无形资产关键词排名点击器
  • iis默认网站建设中网络营销的未来发展趋势
  • 继续坚持网站建设监管佛山百度推广电话
  • 网站设计代做百度网站怎么申请注册
  • 金坛网站制作哈尔滨优化调整人员流动管理
  • 做画册找什么网站百度热搜广告设计公司
  • 济南免费网站制作河北seo网络优化培训
  • 在乐文网站做翻译靠谱吗国外网站建设
  • 福州网站建设H5百度 营销推广怎么做
  • 做网站找毛叶子歌推广怎么做才可以赚钱
  • 静态企业网站下载中央广播电视总台
  • 南昌制作网站软件长春seo排名收费