摘要:
函数的定义 没有返回值: def f(): print("Hello World") f() #调用函数 有1个返回值 def f(a,b): c=a+b return c #return后面的代码不在执行,默认返回None i=f(5,7) print(i) 有多个返回值 def f(a,b): 阅读全文
posted @ 2019-04-07 19:20
天子骄龙
阅读(154)
评论(0)
推荐(0)
摘要:
格式:结果=目标类型(待转数据) s='1234' a=int(s) #字符串转换成整数 s=str(a) #整数转换成字符串 #注意:字符串转换为数值类型时,必须长得像 # i=int("2.3") 会报错,因为2.3不像整数 转换之后是false print(bool(0)) print(boo 阅读全文
posted @ 2019-04-07 14:06
天子骄龙
阅读(169)
评论(0)
推荐(0)
摘要:
定时器的操作方法有两种: 方法一:利用每个对象包含的timerEvent函数 方法二:利用定时器模块 需要 from PyQt5.QtCore import QTimer 方法一:利用每个对象包含的timerEvent函数 例子:在标签控件中显示从10到0的倒计时,显示0时停止 说明:label = 阅读全文
posted @ 2019-04-07 06:00
天子骄龙
阅读(5503)
评论(0)
推荐(0)

浙公网安备 33010602011771号