会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Crazy_Star
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
11
12
13
14
15
16
17
18
19
···
30
下一页
2019年12月22日
pygame游戏框架
摘要: #_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
阅读(456)
评论(0)
推荐(0)
2019年12月21日
事件处理
摘要: #_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
阅读(481)
评论(0)
推荐(0)
2019年12月20日
创建一个wx.App的子类
摘要: #_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
阅读(470)
评论(0)
推荐(0)
2019年12月19日
python操作pymysql
摘要: #_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
阅读(494)
评论(0)
推荐(0)
2019年12月18日
使用raise语句抛出异常
摘要: #_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
阅读(1162)
评论(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
阅读(114)
评论(0)
推荐(0)
创建TCP服务器和TCP客户端
摘要: 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
阅读(887)
评论(0)
推荐(0)
2019年12月17日
生产者消费者模式-->线程
摘要: #_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
阅读(266)
评论(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
阅读(252)
评论(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
阅读(160)
评论(0)
推荐(0)
上一页
1
···
11
12
13
14
15
16
17
18
19
···
30
下一页
公告