上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 30 下一页
摘要: #_author:来童星#date:2019/12/22 import pygame import sys pygame.init() size=width,height=640,480 screen=pygame.display.set_mode(size) color=(0,0,0) ball= 阅读全文
posted @ 2019-12-22 21:49 Stary_tx 阅读(446) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/21# 事件处理import wxclass MyFrame(wx.Frame): def __init__(self,parent,id): wx.Frame.__init__(self,parent,id,'用户登录',size=(400,30 阅读全文
posted @ 2019-12-21 12:12 Stary_tx 阅读(478) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/20#创建一个wx.App的子类import wxclass App(wx.App): #初始化方法 def OnInit(self): frame=wx.Frame(parent=None,title='hello wxpython')# 创建窗 阅读全文
posted @ 2019-12-20 09:48 Stary_tx 阅读(458) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/19import pymysql#1.打开数据库连接db=pymysql.connect('localhost','root','root','test')#2.使用cursor()方法创建一个游标对象cursor=db.cursor()#3.使用 阅读全文
posted @ 2019-12-19 22:04 Stary_tx 阅读(492) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/18def division(): num1=int(input('请输入被除数:')) num2=int(input('请输入除数:')) if num2==0: raise ValueError('除数不能为0') result=num1//n 阅读全文
posted @ 2019-12-18 19:48 Stary_tx 阅读(1138) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/18def division(): num1=int(input('请输入被除数:')) num2=int(input('请输入除数:')) result=num1//num2 print(result)if __name__=='__main__ 阅读全文
posted @ 2019-12-18 19:41 Stary_tx 阅读(112) 评论(0) 推荐(0) 编辑
摘要: import sockethost='127.0.0.1'port=8080web=socket.socket()web.bind((host,port))web.listen(5)# 设置最多连接数print('服务器等待客户端连接')#开启死循环while True: coon,addr=web 阅读全文
posted @ 2019-12-18 18:47 Stary_tx 阅读(878) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/17#生产者消费者模式-->线程from queue import Queueimport random,time,threading#生产者class Producer(threading.Thread): def __init__(self,n 阅读全文
posted @ 2019-12-17 15:41 Stary_tx 阅读(262) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/17#互斥锁from threading import Thread,Lockimport timen=100def func(): global n mutex.acquire() temp=n time.sleep(0.1) n=temp-1 阅读全文
posted @ 2019-12-17 15:12 Stary_tx 阅读(250) 评论(0) 推荐(0) 编辑
摘要: #_author:来童星#date:2019/12/17from threading import Threadimport timedef plus(): print('子线程1开始') global num num+=50 print('num is %d'%num) print('子线程1结束 阅读全文
posted @ 2019-12-17 15:04 Stary_tx 阅读(157) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 30 下一页