├── .idea
├── MyChat.iml
├── misc.xml
├── modules.xml
└── workspace.xml
├── Client.py
├── QQSQL.txt
├── Root项目设计文档
├── 刘毅--mysql模块开发文档.txt
├── 卢勇文件下载模块文档.txt
├── 吕祥浩页面模块部分.docx
├── 徐聪文件上传项目文档.txt
├── 袁之恒--游戏模块设计文档.txt
└── 通信模块-胡崖.txt
├── Server.py
├── __pycache__
└── Client.cpython-36.pyc
├── back1.png
├── chengyuan.py
├── feiji-background_1.png
├── feiji
├── Bomber.py
├── __pycache__
│ ├── Bomber.cpython-36.opt-2.pyc
│ ├── Bomber.cpython-36.pyc
│ ├── Bomber.cpython-37.pyc
│ ├── backgroud_roll.cpython-36.pyc
│ ├── background_1.cpython-36.pyc
│ ├── bullet.cpython-36.opt-2.pyc
│ ├── bullet.cpython-36.pyc
│ ├── bullet.cpython-37.pyc
│ ├── enemy.cpython-36.opt-2.pyc
│ ├── enemy.cpython-36.pyc
│ ├── enemy.cpython-37.pyc
│ ├── myplane.cpython-36.opt-2.pyc
│ ├── myplane.cpython-36.pyc
│ ├── myplane.cpython-37.pyc
│ ├── screen.cpython-37.pyc
│ ├── setting.cpython-36.opt-2.pyc
│ ├── setting.cpython-36.pyc
│ ├── setting.cpython-37.pyc
│ ├── supply.cpython-36.opt-2.pyc
│ ├── supply.cpython-36.pyc
│ └── supply.cpython-37.pyc
├── background_1.py
├── bullet.py
├── enemy.py
├── main.py
├── myplane.py
├── record.txt
├── screen.py
├── setting.py
├── start.py
├── supply.py
└── 飞机大战文档.txt
├── images
├── 1.0.png
├── 1.png
├── 2-1.png
├── 2-2.png
├── 2-3.png
├── 2-4.png
├── 2-5.png
├── 2-6.png
├── 2-7.png
├── 2.png
├── 3-0.png
├── 3-1.png
├── 3-2.png
├── 3-3.png
├── 3-4.png
├── 3-5.png
├── 3-6.png
├── 3.png
├── 4.png
├── Chat - 副本.jpg
├── Chat.jpg
├── Chat.psd
├── Chat_08.gif
├── Chat_09.gif
├── Chat_10.gif
├── Chat_11.gif
├── a4-1.png
├── add.png
├── add0.jpg
├── again.png
├── avatar0.jpg
├── avatar1.jpg
├── avatar2.jpg
├── avatar3.jpg
├── avatar4.jpg
├── back1.png
├── background1.png
├── background2.png
├── bg.jpg
├── bomb.png
├── bomb_supply.png
├── boss.png
├── boss1.png
├── boss2.png
├── boss3.png
├── boss4.png
├── boss5.png
├── boss6.png
├── boss7.png
├── boss8.png
├── btn_quit.png
├── btn_quithover.png
├── btn_send.png
├── btn_sendhover.png
├── bullet1.png
├── bullet2.png
├── bullet_supply.png
├── file.jpg
├── file.png
├── file0.jpg
├── game.png
├── gameover.png
├── hongzhaji.png
├── image_1.jpg
├── image_2.jpg
├── image_3.jpg
├── image_4.jpg
├── image_5.jpg
├── img_cloud_1.png
├── img_cloud_2.png
├── info.png
├── life.png
├── login.psd
├── me1.png
├── me2.png
├── me_destroy_1.png
├── me_destroy_2.png
├── me_destroy_3.png
├── me_destroy_4.png
├── me_destroy_5.png
├── pause_nor.png
├── pause_pressed.png
├── resume_nor.png
├── resume_pressed.png
├── shuaxin.png
├── timg.jpg
└── upfile.png
├── module
├── __pycache__
│ ├── connectDB.cpython-36.pyc
│ ├── haoyou_select.cpython-36.pyc
│ ├── items.cpython-36.pyc
│ ├── mysqlRoot.cpython-36.pyc
│ ├── pushbutton.cpython-36.pyc
│ ├── turles1.cpython-36.pyc
│ ├── two.cpython-36.pyc
│ └── zc2.cpython-36.pyc
├── haoyou.py
├── haoyou_select.py
├── items - 副本.py
├── items.py
├── mysqlRoot.py
├── pushbutton.py
├── turles1.py
├── two.py
├── zc2.py
└── zhuce.txt
├── sound
├── bullet.wav
├── button.wav
├── enemy1_down.wav
├── enemy2_down.wav
├── enemy3_down.wav
├── enemy3_flying.wav
├── game_music.ogg
├── get_bomb.wav
├── get_bullet.wav
├── me_down.wav
├── supply.wav
├── upgrade.wav
└── use_bomb.wav
├── start_back.png
├── tftp_server.py
├── upload.png
├── view
├── Chat - 副本.py
├── Chat - 副本.ui
├── Chat.py
├── Chat.ui
├── Login.py
├── Login.ui
├── __pycache__
│ ├── Chat.cpython-36.pyc
│ └── Login.cpython-36.pyc
├── pushbutton.ui
└── qss
│ ├── Chat_style.qss
│ └── Login_style.qss
├── xiangqing.txt
├── xiazai.py
├── yanzhengma.png
└── zc
├── .idea
├── misc.xml
├── modules.xml
├── workspace.xml
└── zc.iml
├── 123.txt
├── __pycache__
├── mysqlRoot.cpython-36.pyc
├── pushbutton2.cpython-36.pyc
└── shangchuan.cpython-36.pyc
├── avatar0.jpg
├── background.png
├── bomb.png
├── icon.png
├── icon1.png
├── icon2.png
├── mysqlRoot.py
├── six.ui
├── test-1.png
├── two.ui
├── venv
├── Lib
│ └── tcl8.6
│ │ └── init.tcl
├── Scripts
│ ├── Activate.ps1
│ ├── _asyncio.pyd
│ ├── _asyncio_d.pyd
│ ├── _bz2.pyd
│ ├── _bz2_d.pyd
│ ├── _ctypes.pyd
│ ├── _ctypes_d.pyd
│ ├── _ctypes_test.pyd
│ ├── _ctypes_test_d.pyd
│ ├── _decimal.pyd
│ ├── _decimal_d.pyd
│ ├── _elementtree.pyd
│ ├── _elementtree_d.pyd
│ ├── _hashlib.pyd
│ ├── _hashlib_d.pyd
│ ├── _lzma.pyd
│ ├── _lzma_d.pyd
│ ├── _msi.pyd
│ ├── _msi_d.pyd
│ ├── _multiprocessing.pyd
│ ├── _multiprocessing_d.pyd
│ ├── _overlapped.pyd
│ ├── _overlapped_d.pyd
│ ├── _socket.pyd
│ ├── _socket_d.pyd
│ ├── _sqlite3.pyd
│ ├── _sqlite3_d.pyd
│ ├── _ssl.pyd
│ ├── _ssl_d.pyd
│ ├── _testbuffer.pyd
│ ├── _testbuffer_d.pyd
│ ├── _testcapi.pyd
│ ├── _testcapi_d.pyd
│ ├── _testconsole.pyd
│ ├── _testconsole_d.pyd
│ ├── _testimportmultiple.pyd
│ ├── _testimportmultiple_d.pyd
│ ├── _testmultiphase.pyd
│ ├── _testmultiphase_d.pyd
│ ├── _tkinter.pyd
│ ├── _tkinter_d.pyd
│ ├── activate
│ ├── activate.bat
│ ├── deactivate.bat
│ ├── opencv_ffmpeg340_64.dll
│ ├── pyexpat.pyd
│ ├── pyexpat_d.pyd
│ ├── python.exe
│ ├── python3.dll
│ ├── python36.dll
│ ├── python36_d.dll
│ ├── python3_d.dll
│ ├── python_d.exe
│ ├── pythonw.exe
│ ├── pythonw_d.exe
│ ├── select.pyd
│ ├── select_d.pyd
│ ├── sqlite3.dll
│ ├── sqlite3_d.dll
│ ├── tcl86t.dll
│ ├── tcl86tg.dll
│ ├── tk86t.dll
│ ├── tk86tg.dll
│ ├── unicodedata.pyd
│ ├── unicodedata_d.pyd
│ ├── vcruntime140.dll
│ ├── winsound.pyd
│ └── winsound_d.pyd
└── pyvenv.cfg
├── yanzhengma.png
├── zc1.ui
├── zc2.ui
└── zc3.ui
/.idea/MyChat.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Client.py:
--------------------------------------------------------------------------------
1 | from view.Login import Ui_ChatLoginWindow
2 | from view.Chat import Ui_ChatForm
3 | from module.haoyou_select import Ui_ADD
4 | from module.pushbutton import Ui_Zhuce
5 | from socket import *
6 | import sys
7 | import threading
8 | import time
9 | import json
10 |
11 | from PyQt5.QtWidgets import *
12 | from PyQt5.QtGui import *
13 | from PyQt5.QtCore import *
14 | import module.items
15 | import os
16 |
17 |
18 | class LoginWindow(QMainWindow, Ui_ChatLoginWindow):
19 | def __init__(self):
20 | super().__init__()
21 | self.setupUi(self)
22 |
23 | qss_file = open('view/qss/Login_style.qss').read()
24 | self.setStyleSheet(qss_file)
25 | self.txt_pwd.setEchoMode(QLineEdit.Password)
26 |
27 | ADDR = ('127.0.0.1', 8025)
28 |
29 | self.s = socket()
30 | self.s.connect(ADDR)
31 | self.rootname = ''
32 | self.my_info = {}
33 | self.friends_list = []
34 |
35 | #信号槽
36 | self.btn_login.clicked.connect(self.login_click)
37 | self.chk_register.clicked.connect(self.zhuce_click)
38 |
39 |
40 | def zhuce_click(self):
41 | self.zhuce = Ui_Zhuce(self.s)
42 | self.zhuce.show()
43 | self.zhuce.textB()
44 |
45 |
46 | def login_click(self):
47 | self.rootname = self.txt_user.text()
48 | pwd = self.txt_pwd.text()
49 | self.s.send(("L " + self.rootname + " " + pwd).encode())
50 | data = self.s.recv(128).decode()
51 | print("login_click>data", data)
52 | if data == "True":
53 | print("登陆成功")
54 |
55 | data = json.loads(self.s.recv(4096).decode())
56 |
57 | self.friends_list = data
58 | print("login_click>friends",self.friends_list)
59 |
60 | data = json.loads(self.s.recv(1024).decode())
61 | self.my_info = data
62 | print("login_click>my_info", self.my_info)
63 |
64 | # miss_msg = json.loads(self.s.recv(4096).decode())
65 |
66 | self.hide()
67 | self.dia = Mychat(self.my_info, self.s, self.friends_list)
68 | self.dia.show()
69 |
70 | else:
71 | QMessageBox.information(self, "提示", "用户名或密码错误!",
72 | QMessageBox.Yes)
73 | self.txt_user.clear()
74 | self.txt_pwd.clear()
75 |
76 |
77 | class Mychat(QMainWindow, Ui_ChatForm):
78 | def __init__(self, my_info, s, friend_list):
79 | super().__init__()
80 | self.setupUi(self)
81 | qss_file = open('view/qss/Chat_style.qss').read()
82 | self.setStyleSheet(qss_file)
83 | self.my_info = my_info
84 | self.s = s
85 | self.friend_list = friend_list
86 | print("Mychat> friendlist>", friend_list)
87 | # self.threads = []
88 | # self.friend_info = {}
89 |
90 | friend_list.insert(0, ['小Root', 1000, 'images/avatar0.jpg'])
91 | self.friend_list = friend_list
92 | self.listWidget1_1._set_items(self.friend_list)
93 | # self.show_item()
94 |
95 | self.history_list = {}
96 |
97 | self.chat_th = threading.Thread(target=self.Recv) # 创建接收信息线程
98 | self.chat_th.setDaemon(True)
99 | self.chat_th.start()
100 |
101 | self.send_Button.clicked.connect(self.Send)
102 | self.quit_Button.clicked.connect(self.Quit)
103 | self.pushButton_4.clicked.connect(self.play_xinxi)
104 | self.pushButton_2.clicked.connect(self.play_flie)
105 | self.pushButton.clicked.connect(self.play_jiahaoyou)
106 |
107 | self.pushButton_7.clicked.connect(self.show_item)
108 |
109 | self.pushButton_3.clicked.connect(self.play_feiji)
110 |
111 |
112 | self.listWidget1_1.set_doubleclick_slot(self.chat)
113 |
114 |
115 | print("进入了Mychat")
116 |
117 | self.chat3()
118 |
119 | def play_feiji(self):
120 | os.system("python ./feiji/start.py")
121 |
122 | def show_item(self):
123 | self.listWidget1_1._set_items(self.friend_list)
124 | print("show_item>end")
125 |
126 | def play_jiahaoyou(self):
127 | # os.system("python ./haoyou_select.py")
128 | self.add = Ui_ADD(self.my_info,self.s)
129 | self.add.show()
130 | # self.s.send(("P " + self.my_info['rootname']).encode())
131 |
132 | def play_flie(self):
133 | os.system("python ./xiazai.py")
134 |
135 |
136 | def play_xinxi(self):
137 | os.system("python ./chengyuan.py")
138 |
139 |
140 |
141 | def closeEvent(self, QCloseEvent):
142 | print("进入closeEvent")
143 | self.s.send(('Q ' + self.my_info["rootname"]).encode())
144 |
145 |
146 |
147 | def Quit(self):
148 | self.s.send(('Q ' + self.my_info["rootname"]).encode())
149 | sys.exit()
150 |
151 | def chat3(self):
152 | self.friend_info = dict(zip(
153 | ["type", "rootname", "nickname", "gender", "tel", "address", "email", "birthday", "avatar", "style",
154 | "onlinestatus"],
155 | ["I", "1000", "小Root", "女", '861008610010', '野生技术协会', '10086@10010.com', '1月1日', 'images/avatar0.jpg',
156 | '人生苦短,我用Python', '在线']))
157 | self.showinit(self.friend_info)
158 |
159 | self.s.send(('T ' + '离线消息').encode())
160 | time.sleep(0.5)
161 | self.s.send(json.dumps(self.my_info).encode())
162 | print("init执行完毕")
163 | self.textBrowser.clear()
164 |
165 |
166 | def chat(self, name, mac):
167 | if mac =="1000":
168 | self.chat3()
169 | else:
170 | print("chat>mac", mac)
171 | self.s.send(('C ' + self.my_info["rootname"] + " " + mac).encode())
172 | self.textBrowser.clear()
173 | time.sleep(0.5)
174 | print("chathistory>",self.history_list)
175 | for line in self.history_list:
176 | self.textBrowser.append(line)
177 |
178 |
179 | def showinit(self, friend_info):
180 | print("进入了showinit")
181 | self.chatname_label.setText(friend_info["nickname"])
182 | print("1")
183 | self.my_avatar_label.setStyleSheet("background-color: gainsboro;border-image: url('%s');" % self.my_info["avatar"])
184 | self.f_avatar_label.setStyleSheet("background-color: gainsboro;border-image: url('%s');" % friend_info["avatar"])
185 | print("2")
186 | self.f_nickname_label.setText(friend_info["nickname"])
187 | print("3")
188 | self.style_label.setText(friend_info["style"])
189 | print("4")
190 | self.address_label.setText(friend_info["address"])
191 | print("5")
192 | self.email_label.setText(friend_info["email"])
193 | print("6")
194 | self.tel_label.setText(friend_info["tel"])
195 | print("7")
196 | self.birthday_label.setText(friend_info["birthday"])
197 | print("8")
198 | self.onlinestatus_label.setText(friend_info["onlinestatus"])
199 |
200 | print("showinit执行完毕")
201 |
202 | def Send(self): # 发送消息
203 | data = self.textEdit.toPlainText()
204 | print("Send:", data)
205 |
206 | if self.friend_info["rootname"] == "1000":
207 | tldata = "T " + data
208 | text = self.my_info["nickname"] + ' ' + "%02d:%02d:%02d" % time.localtime()[3:6] + '\n' + data +'\n'
209 | self.s.send(tldata.encode())
210 | time.sleep(1)
211 | self.s.send(json.dumps(self.my_info).encode())
212 | print("Send>end")
213 | else:
214 | text = self.my_info["nickname"] + ' ' + "%02d:%02d:%02d" % time.localtime()[3:6] + '\n' + data +'\n'
215 | tldata = self.my_info["rootname"] + ' ' + self.friend_info["rootname"] + ' ' + text
216 | print(text)
217 | self.s.send(tldata.encode())
218 |
219 | self.textBrowser.append(text)
220 |
221 | # 每次发送完消息,清空发送框
222 | self.textEdit.setText("")
223 |
224 | def Recv(self): # 接受消息
225 | while True:
226 | try:
227 | data = json.loads(self.s.recv(4096).decode())
228 | except Exception as e:
229 | print(e)
230 | print("Recv:", data)
231 | # 好友信息
232 | if data["type"] == "I":
233 | self.friend_info = data
234 | self.showinit(self.friend_info)
235 | # 历史记录
236 | elif data["type"] == "H":
237 | self.history_list = data["record"]
238 | print("历史记录>", self.history_list)
239 |
240 | elif data["type"] == "M":
241 | print("执行到了type=M")
242 | for line in data["miss_msg"]:
243 | self.textBrowser.append(line)
244 |
245 | elif data["type"] == "P":
246 | self.friend_list = data["friends_list"]
247 | self.friend_list.insert(0, ['小Root', 1000, 'images/avatar0.jpg'])
248 | print('data["type"] == "P"', self.friend_list)
249 |
250 | elif data["type"] == "F":
251 | print("执行到了type=F")
252 | self.add.recvinfo(data["info"])
253 | self.s.send(("P " + self.my_info['rootname']).encode())
254 | # if data["info"]:
255 | # self.friend_list.append([data["info"][1] , data["info"][0], data["info"][7]])
256 |
257 | elif data["type"] == "V":
258 | print("执行到了type=F")
259 | self.add.recvinfo1(data["info"])
260 | self.s.send(("P " + self.my_info['rootname']).encode())
261 |
262 | # 聊天信息
263 | elif data["type"] == "S":
264 | if data["rootname"] == self.friend_info["rootname"]:
265 | self.textBrowser.append(data["msg"])
266 | elif data["rootname"] == self.my_info["rootname"]:
267 | self.textBrowser.append("该好友未上线, 可能暂时无法回复您的信息\n")
268 | else:
269 | # 有新消息提示
270 | self.textBrowser.append("有来自 %s 的一条新的消息" % data["rootname"] + "\n")
271 |
272 |
273 |
274 | if __name__ == "__main__":
275 | app = QApplication(sys.argv)
276 | chat = LoginWindow()
277 | chat.show()
278 | sys.exit(app.exec_())
279 |
280 |
281 |
--------------------------------------------------------------------------------
/QQSQL.txt:
--------------------------------------------------------------------------------
1 | # QQSQL.txt
2 |
3 | 数据表:分为 用户信息表(users) 好友关系表(friends) 聊天记录表 (history)
4 |
5 | 数据库代码(直接复制使用即可)
6 | ---------------------------------------------------------------------------------------------------------------
7 | create database RootDB default character set utf8;
8 |
9 | use RootDB;
10 |
11 | create table users(
12 | id int auto_increment primary key,
13 | rootname int,
14 | nickname varchar(20),
15 | pwd varchar(32),
16 | gender enum("男","女","保密"),
17 | tel varchar(11),
18 | address varchar(100),
19 | email varchar(30),
20 | birthday varchar(15),
21 | avatar text,
22 | style varchar(100),
23 | onlinestatus enum("在线","离线"),
24 | time timestamp default now(),
25 | last_online timestamp default now())character set utf8;
26 |
27 | insert into users(rootname,nickname,pwd,gender,tel,address,email,birthday,avatar,style,onlinestatus) values("10000","10000的昵称","123","男","13434557788","湖北省武汉市青山区东湖景园","488658752@qq.com","5月4日","images/avatar1.jpg","这个人很懒,什么都没留下!","离线")
28 | ,("10001","10001的昵称","123","男","13438874114","湖北省武汉市洪山区光谷","789658752@qq.com","6月15日","images/avatar2.jpg","天空飘来5个字,这都不是事","离线"),("10002","10002的昵称","123","男","18974557788","北京市朝阳区吃瓜群众聚集地","983658752@qq.com","1月26日","images/avatar3.jpg","我是谁,我在干什么,这里是哪里!","离线");
29 |
30 | create table friends(
31 | id int auto_increment primary key,
32 | rootname int not null,
33 | f_rootname int not null)character set utf8;
34 |
35 | insert into friends(rootname,f_rootname) values("10000","10001"),("10000","10002"),("10001","10000"),("10001","10002"),("10002","10000"),("10002","10001");
36 |
37 | create table history(
38 | id int auto_increment primary key,
39 | rootname int not null,
40 | f_rootname int not null,
41 | record text,
42 | time timestamp default now())character set utf8;
43 |
44 | ---------------------------------------------------------------------------------------------------------------
45 |
46 | 数据库: RootDB
47 | create database RootDB default character set utf8;
48 |
49 | -----------------------------------------------------
50 | 用户信息表(users):
51 |
52 | id(int) rootname(int)(自动随机生成) nickname(varchar(20) pwd(varchar(16)(MD5加密) gender(enum("男","女","保密"))) tel(varchar(11)) address(varchar(100) email(varchar(30)) birthday(varchar(15)) avatar(text) style(varchar(100)) onlinestatus(enum(1,0)) time(timestamp)(注册时间) last_online(timestamp)
53 | -----------------------------------------------------
54 |
55 | 好友关系表(friends):
56 |
57 | id(int) rootname(int) f_rootname(int)
58 | 0 10000 10001
59 | 1 10001 10000
60 |
61 | ------------------------------------------------
62 |
63 | 历史记录表(history)
64 |
65 | id(int) rootname(int) f_rootname(int) record(text) time(timestamp)
66 | 0 10000 10001 你好 ...
67 | 1 10000 10001 在干嘛 ...
68 | 2 10001 10000 在学习 ...
69 |
70 | select record from history where (rootname = 10000 and f_rootname = 10001) or (rootname = 10001 and f_rootname = 10000) order by id desc limit 5;
--------------------------------------------------------------------------------
/Root项目设计文档/刘毅--mysql模块开发文档.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/Root项目设计文档/刘毅--mysql模块开发文档.txt
--------------------------------------------------------------------------------
/Root项目设计文档/卢勇文件下载模块文档.txt:
--------------------------------------------------------------------------------
1 | 文件上传下载
2 |
3 | 一.配置环境: python3
4 | pycharm --QtDesigner
5 | --pyUIc
6 | Qt5
7 | 二.项目结构
8 | |---server.py 服务端
9 | |----do list 列出下载列表
10 | |----do put 发送文件
11 | |---client.py 客户端
12 | |----loadfile 下载
13 | |----save_path 保存路径
14 | |----flush 刷新下载文档
15 | |----jump_to_erji 跳转二级界面
16 |
17 | 三.项目创建流程
18 |
19 | 第一阶段:
20 | 确定下载的传输协议:tcp传输
21 | 确定下载的思路:服务端负责列出可下载文件并发送文件,客户端负责读取可下载文件并发出命令.
22 | server:|---file_list = os.listdir(FILE_PATH) 列出可下载列表
23 | |---self.connfd.send(data) 发送文件
24 | client:|---self.textBrowser = QtWidgets.QTextBrowser(self.centralwidget)-->self.textBrowser.append(file) 列出可下载列表
25 | |---data = s.recv(1024).decode()--> fd.write(data) 下载文件
26 | 构建出能相互通信的服务器与客户端框架,测试套接字连接成功
27 |
28 | 第二阶段:
29 | 确定运行环境:基于python3 pyqt5模块开发
30 | 确定需求功能:下载需要获取可下载文件和下载路径
31 | 下载路径的确定:
32 | openfile_name = QFileDialog.getExistingDirectory() ---获取选择的路径
33 | 通过designer创建ui界面并获取代码
34 |
35 | 第三阶段:
36 | 在ui类下根据各个按键需求的功能编写方法(
37 | 这里需要注意的是服务端与客户端之间的
38 | 交互需要自己来协调,两端不断调试保持一致.
39 | 例如:
40 | if not data or data[0] == 'Q'
41 | print(self.connfd.getpeername, "客户端退出")
42 | self.connfd.close()
43 | sys.exit(0)
44 | elif data[0] == "L":
45 | self.do_list()
46 | elif data[0] == "G":
47 | filename = data[2:]
48 | self.do_get(filename)
49 | 这里规定了客户端发出的命令格式,因此在写客户端方法时要严格按照该方法执行
50 | s.send(('G ' + word).encode())
51 | 此处G对应服务端命令格式,word对应命令内容
52 | )
53 | 用clicked.connect方法绑定按钮与方法,实现点击按钮就运行方法
54 | self.pushButton.clicked.connect(self.loadfile)
55 | 这段代码表示将pushButton绑定到loadfile方法上,点击pushButton按钮运行loadfile方法
56 | 第四阶段:
57 | 整体整合阶段,寻找可以优化的地方
58 | 在此阶段我们把下载功能放在二级界面中优化了其操作性
59 |
60 | def jump_to_erji(self):
61 | self.MainWindow.hide()
62 | MainWindow1 = QtWidgets.QDialog()
63 | ui = Ui_MainWindow1()
64 | ui.setupUi(MainWindow1)
65 | MainWindow1.show()
66 | MainWindow1.exec_()
67 | self.MainWindow.show()
68 | 这一块注意,是重点从主界面跳转到Ui_MainWindow1界面,主界面隐藏,如果关闭MainWindow界面,主界面进程会触发self.form.show()会再次显示主界面
69 | 新增了一个文本框让客户端选择的下载路径可视化
70 | self.textBrowser_2 = QtWidgets.QTextBrowser(self.centralwidget)|
71 | self.textBrowser_2.append(lujing) |---可视化路径
72 | 第五阶段:
73 | 把下载类导入到项目主窗口中
74 | 最开始我们用二级窗口通过导入类方法来实现打开二级界面
75 | 后来我觉得这种方法过于繁琐,而且上传下载功能本身就是一个独立的模块
76 | 于是我建议使用os.system()方法直接以打开文件的方式启动
77 | 最后我们在主界面的一个按钮上绑定openfile方法
78 | def openfile(self):
79 | import os
80 | MainWindow.close()
81 | os.system("python xiazai.py")
82 | 这样更加符合高聚合低耦合的要求
83 |
84 | 第六阶段:
85 | 联机测试:在不同的电脑上对服务器进行上传下载操作,成功则项目完成!
86 |
--------------------------------------------------------------------------------
/Root项目设计文档/吕祥浩页面模块部分.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/Root项目设计文档/吕祥浩页面模块部分.docx
--------------------------------------------------------------------------------
/Root项目设计文档/徐聪文件上传项目文档.txt:
--------------------------------------------------------------------------------
1 | 项目名称 :文件上传与下载
2 |
3 | 功能说明 :
4 | 用户可以上传文件到服务器,其他用户可自由下载
5 |
6 | 项目分析:
7 | 模块:
8 | os
9 | socket
10 | multiprocessing
11 | QtDesigner
12 | pyUIc
13 | pyqt5
14 |
15 | 服务器功能:
16 | 接收多个用户的请求并实现如下功能
17 | 1.接收到用户的查询请求时,返回指定文件夹下所有文件名的列表
18 | 2.接收到用户的上传请求时,判断是否能上传,若能则接收文件并存储在指定文件夹下
19 | 3.接收到用户的下载请求时,若文件存在则将文件发送给客户端
20 | 1.遇到问题:windons系统不能使用fork实现多进程
21 | 1.解决办法:改为multiprocessing实现多进程,期间出现不能多用户同时登陆,通过增加延迟解决
22 | for p in Lp:
23 | p.start()
24 | time.sleep(0.1)
25 | for p in Lp:
26 | p.join()
27 |
28 | 客户端功能:
29 | 通过qt实现界面化,发送上传、刷新、下载命令到服务器并返回的结果,将结果显示在界面上或者将文件存储在指定文件夹
30 |
31 | 项目流程:
32 | 1.写服务端与客户端
33 | 使用tcp套接字,multiprocessing实现多进程
34 | 客户端发送上传、刷新、下载请求,服务端能实现相应的功能
35 | 2.做界面
36 | 通过QtDesigner实现界面布局,有上传、刷新、下载、显示列表等按键
37 | 3.按键绑定功能
38 | 将之前客户端写好的各项功能绑定在对应的按键上
39 | 上传、刷新、下载:点击对应按钮启动功能
40 | self.pushButton.clicked.connect(self.fn)
41 | 将文件列表显示在对应窗口:
42 | self.textBrowser.append(file)
43 | 打开文件(上传):
44 | openfile_name = QFileDialog.getOpenFileName(self)
45 | 打开文件夹(保存路径):
46 | openfile_name = QFileDialog.getExistingDirectory()
47 |
48 | 1.遇到问题:当用户点击上传或者选择路径按钮时,如果点了取消或直接关闭界面,程序会直接崩溃。
49 | 1.解决办法:在上传的连接服务器阶段之前,先做个判断,如果选择了文件才开始连接服务器实现上传,如果没选文件,则啥都不做。至于选择路径功能,则是做了一个全局变量为桌面的默认路径,如果没选路径则默认桌面,选了就修改这个全局变量为选择的路径。
50 | if l[0][0]: #判断是否选择了文件
51 | 连接服务器
52 |
53 | lujing = 'C:/Users/Administrator/Desktop/' #全局变量
54 | 4.本机测试
55 | 在本机测试是否能实现所有功能
56 | 5.联机测试
57 | 测试多个用户是否能同时登陆、上传、下载,以及下载大文件是否卡顿。
58 | 1.遇到问题:客户端还是只能登陆一个
59 | 1.解决办法:通过检查发现原因,客户端由于有4个地方需要连接服务器,代码重复多,于是把套接字设置成了全局变量,导致出现问题。后来把每个需要连接服务器的地方都分别设置套接字,每个功能都是一个新的进程。
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/Root项目设计文档/通信模块-胡崖.txt:
--------------------------------------------------------------------------------
1 | 聊天功能
2 |
3 | 一.配置环境: python3
4 | pycharm --QtDesigner
5 | --pyUIc
6 | Qt5
7 | 二.项目结构
8 | |---server.py 服务端
9 | |---module.mysqlRoot 数据库
10 |
11 | |---client.py 客户端(登录界面)
12 | |----module.haoyou_select 增删好友界面
13 | |----module.pushbutton 注册界面
14 |
15 | 主要技术 : TCP socket 通信, PyQt5 图形化, Qss页面美化, 多线程, IO多路复用, 数据库MySQL
16 |
17 | 设计流程 :
18 |
19 | 客户端 : 登录请求, 注册请求, 聊天请求, 离线消息请求, 好友请求, 退出请求, 接收好友消息, 接收服务端响应消息
20 |
21 | 服务端 : 并发连接, 并响应客户端各种请求, 分别处理
22 |
23 |
24 | 三.项目创建流程
25 |
26 | 第一阶段:
27 | 确定聊天的传输协议:tcp套接字
28 | 确定聊天的思路:服务端负责接收客户端发送的请求并反馈, 客户端负责发送操作请求.
29 |
30 | server:|---serve_forever() 启动服务器, 利用IO多路复用并发
31 | server:|---handle() 解析客户端请求码, 做响应函数操作
32 | server:|---login() 比对数据库的用户名和密码, 成功则反馈给客户端相应信息
33 | server:|---...() 类似login()操作
34 |
35 | client:|---LoginWindow 登录页面类
36 | client:|---Mychat 聊天页面类
37 |
38 | 构建出能相互通信的服务器与客户端框架, 测试多客户端并发套接字连接成功
39 |
40 | 第二阶段:
41 | 确定运行环境:基于python3 pyqt5模块开发
42 | 确定需求功能:聊天功能
43 | 创建登录界面, 创建聊天界面
44 | 通过designer创建ui界面并获取代码
45 |
46 | 第三阶段:
47 | 在ui类下根据各个按键需求的功能编写方法(
48 | 这里需要注意的是服务端与客户端之间的
49 | 交互需要自己来协调,两端不断调试保持一致.
50 | 例如:
51 | 登录功能:
52 |
53 | def login_click(self):
54 | '''
55 | 登录功能
56 | :return:
57 | '''
58 | self.rootname = self.txt_user.text()
59 | pwd = self.txt_pwd.text()
60 | self.s.send(("L " + self.rootname + " " + pwd).encode())
61 | data = self.s.recv(128).decode()
62 | if data == "True":
63 | print("登陆成功")
64 |
65 | data = json.loads(self.s.recv(1024).decode())
66 | self.friends_list = data
67 |
68 | data = json.loads(self.s.recv(1024).decode())
69 | self.my_info = data
70 |
71 | # miss_msg = json.loads(self.s.recv(4096).decode())
72 |
73 | self.hide()
74 | self.dia = Mychat(self.my_info, self.s, self.friends_list)
75 | self.dia.show()
76 |
77 | else:
78 | print("登陆失败")
79 |
80 | 好友列表展示功能:
81 | def show_item(self):
82 | '''
83 | 好友列表显示
84 | :return:
85 | '''
86 | self.listWidget1_1._set_items(self.friend_list)
87 | 这里重写了PyQt的listWidget控件
88 |
89 |
90 | 好友间聊天功能:
91 | def chat(self, name, mac):
92 | '''
93 | 选择好友聊天功能
94 | :param name: 好友昵称
95 | :param mac: 好友rootname
96 | :return:
97 | '''
98 | if mac =="1000":
99 | self.chat3()
100 | else:
101 | self.s.send(('C ' + self.my_info["rootname"] + " " + mac).encode())
102 | self.textBrowser.clear()
103 | time.sleep(0.5)
104 | for line in self.history_list:
105 | self.textBrowser.append(line)
106 | ... ...
107 |
108 | 在聊天列表控件用clicked.connect方法绑定方法,实现点击好友名就运行方法
109 | self.list_widget.itemClicked.connect(self.item_doubleclick_slot)
110 | 这段代码表示将itemClicked绑定到chat方法上,点击items运行chat方法
111 |
112 | 客户端的接收消息方法,单独使用一个线程, 消息不会丢下
113 |
114 | 第四阶段:
115 | 整体整合阶段,寻找可以优化的地方
116 | 在此阶段我们把聊天功能进行了信息的分类, 如历史记录, 未接消息
117 | 并且增加了好友的增删, 新消息提醒等
118 |
119 | # 历史记录
120 | elif data["type"] == "H":
121 | self.history_list = data["record"]
122 | # 未接消息
123 | elif data["type"] == "M":
124 | for line in data["miss_msg"]:
125 | self.textBrowser.append(line)
126 | # 加好友消息
127 | elif data["type"] == "F":
128 | self.add.recvinfo(data["info"])
129 | if data["info"]:
130 | self.friend_list.append([data["info"][1] , data["info"][0], data["info"][7]])
131 |
132 | # 聊天消息
133 | elif data["type"] == "S":
134 | if data["rootname"] == self.friend_info["rootname"]:
135 | self.textBrowser.append(data["msg"])
136 | elif data["rootname"] == self.my_info["rootname"]:
137 | self.textBrowser.append("该好友未上线, 可能暂时无法回复您的信息\n")
138 | else:
139 | # 有新消息提示
140 | self.textBrowser.append("有来自 %s 的一条新的消息" % data["rootname"] + "\n")
141 |
142 | 第五阶段:
143 | 在服务器增加个人小助手功能, 可以返回该用户在离线时候所有的未接消息, 然后为了增添它的功能, 在其中调用了图灵机器人的接口, 可以简单和用户聊天, 并满足用户的部分需求
144 | 为了使程序中数据传递更加方便, 把传递,接收反馈用的字符串, 改为用json格式的方式传递, 更好的处理发送和接收到的数据
145 |
146 | 第六阶段:
147 | 联机测试:在多台电脑上登录客户端, 实现登录注册聊天功能, 能够多用户之间相互聊天
148 |
149 |
150 |
151 |
152 |
--------------------------------------------------------------------------------
/__pycache__/Client.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/__pycache__/Client.cpython-36.pyc
--------------------------------------------------------------------------------
/back1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/back1.png
--------------------------------------------------------------------------------
/feiji-background_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji-background_1.png
--------------------------------------------------------------------------------
/feiji/Bomber.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 | import pygame
4 | import time
5 | import random
6 | from pygame.locals import *
7 |
8 |
9 | class HongZha:
10 | '''轰炸机类'''
11 |
12 | def __init__(self, screen_temp):
13 | self.x = -30
14 | self.y = -150
15 | self.screen = screen_temp
16 | self.image = pygame.image.load("images/hongzhaji.png")
17 | self.direction = "down"
18 |
19 | def display(self):
20 | self.screen.blit(self.image, (self.x, self.y))
21 |
22 | def move(self, move_hz):
23 | # self.y = move_hz
24 | # self.y += 5
25 | if self.direction == "down":
26 | self.y += 3
27 |
28 | elif self.y < 0:
29 | self.direction = "down"
30 |
--------------------------------------------------------------------------------
/feiji/__pycache__/Bomber.cpython-36.opt-2.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/Bomber.cpython-36.opt-2.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/Bomber.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/Bomber.cpython-36.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/Bomber.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/Bomber.cpython-37.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/backgroud_roll.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/backgroud_roll.cpython-36.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/background_1.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/background_1.cpython-36.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/bullet.cpython-36.opt-2.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/bullet.cpython-36.opt-2.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/bullet.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/bullet.cpython-36.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/bullet.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/bullet.cpython-37.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/enemy.cpython-36.opt-2.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/enemy.cpython-36.opt-2.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/enemy.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/enemy.cpython-36.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/enemy.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/enemy.cpython-37.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/myplane.cpython-36.opt-2.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/myplane.cpython-36.opt-2.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/myplane.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/myplane.cpython-36.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/myplane.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/myplane.cpython-37.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/screen.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/screen.cpython-37.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/setting.cpython-36.opt-2.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/setting.cpython-36.opt-2.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/setting.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/setting.cpython-36.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/setting.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/setting.cpython-37.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/supply.cpython-36.opt-2.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/supply.cpython-36.opt-2.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/supply.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/supply.cpython-36.pyc
--------------------------------------------------------------------------------
/feiji/__pycache__/supply.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/feiji/__pycache__/supply.cpython-37.pyc
--------------------------------------------------------------------------------
/feiji/background_1.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 | from random import *
4 | import pygame
5 |
6 |
7 | class Screen(pygame.sprite.Sprite):
8 |
9 | def __init__(self, position, bg_size):
10 | pygame.sprite.Sprite.__init__(self)
11 |
12 | self.width, self.height = bg_size[0], bg_size[1]
13 |
14 | # 设置子弹对象
15 | self.image = pygame.image.load('images/image_1.jpg').convert_alpha()
16 | self.images = []
17 | self.images.extend([
18 | pygame.image.load('images/image_2.jpg').convert_alpha(),
19 | pygame.image.load('images/image_3.jpg').convert_alpha(),
20 | pygame.image.load('images/image_4.jpg').convert_alpha(),
21 | pygame.image.load('images/image_5.jpg').convert_alpha()
22 |
23 | ])
24 |
25 | self.rect = self.image.get_rect()
26 | self.rect.left, self.rect.bottom = position
27 | self.speed = 1
28 | self.action = False
29 |
30 | def move(self):
31 | self.rect.top += self.speed
32 |
33 | if self.rect.bottom > self.height:
34 | self.action = True
35 |
36 |
37 | # class Ground(pygame.sprite.Sprite):
38 |
39 | # def __init__(self, bg_size):
40 | # pygame.sprite.Sprite.__init__(self)
41 |
42 | # self.image = pygame.image.load(
43 | # 'images/img_cloud_1.png').convert_alpha()
44 | # self.images = pygame.image.load(
45 | # 'images/img_cloud_2.png').convert_alpha()
46 | # self.image_s = choice([self.image, self.images])
47 | # self.image_rect = self.image_s.get_rect()
48 | # self.width, self.height = bg_size[0], bg_size[1]
49 | # self.image_rect.left, self.image_rect.bottom = choice([(self.width - self.image_rect.width // 2), (0 - self.image_rect.width // 2)]),\
50 | # randint(-50, -10)
51 | # self.speed = 1
52 |
53 | # def move(self):
54 | # if self.image_rect.top < self.height:
55 | # self.image_rect.top += 1
56 | # else:
57 | # self.reset()
58 |
59 | # def reset(self):
60 |
61 | # self.image_s = choice([self.image, self.images])
62 | # self.image_rect = self.image_s.get_rect()
63 | # self.image_rect.left, self.image_rect.bottom = randint(0 - self.image_rect.width // 2, self.width - self.image_rect.width // 2),\
64 | # randint(-50, -10)
65 |
--------------------------------------------------------------------------------
/feiji/bullet.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 | import pygame
4 |
5 |
6 | class Bullet1(pygame.sprite.Sprite):
7 |
8 | def __init__(self, position):
9 | pygame.sprite.Sprite.__init__(self)
10 |
11 | self.image = pygame.image.load("images/bullet1.png").convert_alpha()
12 | self.rect = self.image.get_rect()
13 | self.rect.left, self.rect.top = position
14 | self.speed = 25
15 | self.active = False
16 | self.mask = pygame.mask.from_surface(self.image)
17 |
18 | def move(self):
19 | self.rect.top -= self.speed
20 |
21 | if self.rect.top < 0:
22 | self.active = False
23 |
24 | def reset(self, position):
25 | self.rect.left, self.rect.top = position
26 | self.active = True
27 |
28 |
29 | class Bullet2(pygame.sprite.Sprite):
30 |
31 | def __init__(self, position):
32 | pygame.sprite.Sprite.__init__(self)
33 |
34 | self.image = pygame.image.load("images/bullet2.png").convert_alpha()
35 | self.rect = self.image.get_rect()
36 | self.rect.left, self.rect.top = position
37 | self.speed = 20
38 | self.active = False
39 | self.mask = pygame.mask.from_surface(self.image)
40 |
41 | def move(self):
42 | self.rect.top -= self.speed
43 |
44 | if self.rect.top < 0:
45 | self.active = False
46 |
47 | def reset(self, position):
48 | self.rect.left, self.rect.top = position
49 | self.active = True
50 |
--------------------------------------------------------------------------------
/feiji/enemy.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 | import pygame
4 | from random import *
5 |
6 |
7 | class SmallEnemy(pygame.sprite.Sprite):
8 |
9 | def __init__(self, bg_size):
10 | pygame.sprite.Sprite.__init__(self)
11 |
12 | self.image = pygame.image.load("images/1.0.png").convert_alpha()
13 | self.destroy_images = []
14 | self.destroy_images.extend([
15 | pygame.image.load("images/1.png").convert_alpha(),
16 | pygame.image.load("images/2.png").convert_alpha(),
17 | pygame.image.load("images/3.png").convert_alpha(),
18 | pygame.image.load("images/4.png").convert_alpha()
19 | ])
20 | self.rect = self.image.get_rect()
21 | self.width, self.height = bg_size[0], bg_size[1]
22 | self.speed = 2
23 | self.active = True
24 | self.rect.left, self.rect.top = \
25 | randint(0, self.width - self.rect.width), \
26 | randint(-5 * self.height, 0)
27 | self.mask = pygame.mask.from_surface(self.image)
28 |
29 | def move(self):
30 | if self.rect.top < self.height:
31 | self.rect.top += self.speed
32 | else:
33 | self.reset()
34 |
35 | def reset(self):
36 | self.active = True
37 | self.rect.left, self.rect.top = \
38 | randint(0, self.width - self.rect.width), \
39 | randint(-5 * self.height, 0)
40 |
41 |
42 | class MidEnemy(pygame.sprite.Sprite):
43 | energy = 8
44 |
45 | def __init__(self, bg_size):
46 | pygame.sprite.Sprite.__init__(self)
47 |
48 | self.image = pygame.image.load("images/2-1.png").convert_alpha()
49 | self.image_hit = pygame.image.load(
50 | "images/2-2.png").convert_alpha()
51 | self.destroy_images = []
52 | self.destroy_images.extend([
53 | pygame.image.load("images/2-2.png").convert_alpha(),
54 | pygame.image.load("images/2-3.png").convert_alpha(),
55 | pygame.image.load("images/2-4.png").convert_alpha(),
56 | pygame.image.load("images/2-5.png").convert_alpha(),
57 | pygame.image.load("images/2-6.png").convert_alpha(),
58 | pygame.image.load("images/2-7.png").convert_alpha()
59 | ])
60 | self.rect = self.image.get_rect()
61 | self.width, self.height = bg_size[0], bg_size[1]
62 | self.speed = 2
63 | self.active = True
64 | self.rect.left, self.rect.top = \
65 | randint(0, self.width - self.rect.width), \
66 | randint(-10 * self.height, -self.height)
67 | self.mask = pygame.mask.from_surface(self.image)
68 | self.energy = MidEnemy.energy
69 | self.hit = False
70 |
71 | def move(self):
72 | if self.rect.top < self.height:
73 | self.rect.top += self.speed
74 | else:
75 | self.reset()
76 |
77 | def reset(self):
78 | self.active = True
79 | self.energy = MidEnemy.energy
80 | self.rect.left, self.rect.top = randint(0, self.width - self.rect.width),\
81 | randint(-10 * self.height, -self.height)
82 |
83 |
84 | class BigEnemy(pygame.sprite.Sprite):
85 | energy = 20
86 |
87 | def __init__(self, bg_size):
88 | pygame.sprite.Sprite.__init__(self)
89 |
90 | self.image = pygame.image.load("images/3-0.png").convert_alpha()
91 | self.image1 = pygame.image.load("images/3-0.png").convert_alpha()
92 | self.image_hit = pygame.image.load(
93 | "images/3-1.png").convert_alpha()
94 | self.destroy_images = []
95 | self.destroy_images.extend([
96 | pygame.image.load("images/3-1.png").convert_alpha(),
97 | pygame.image.load("images/3-2.png").convert_alpha(),
98 | pygame.image.load("images/3-3.png").convert_alpha(),
99 | pygame.image.load("images/3-4.png").convert_alpha(),
100 | pygame.image.load("images/3-5.png").convert_alpha(),
101 | pygame.image.load("images/3-6.png").convert_alpha()
102 | ])
103 | self.rect = self.image1.get_rect()
104 | self.width, self.height = bg_size[0], bg_size[1]
105 | self.speed = 2
106 | self.active = True
107 | self.rect.left, self.rect.top = \
108 | randint(0, self.width - self.rect.width), \
109 | randint(-15 * self.height, -5 * self.height)
110 | self.mask = pygame.mask.from_surface(self.image1)
111 | self.energy = BigEnemy.energy
112 | self.hit = False
113 |
114 | def move(self):
115 | if self.rect.top < self.height:
116 | self.rect.top += self.speed
117 | else:
118 | self.reset()
119 |
120 | def reset(self):
121 | self.active = True
122 | self.energy = BigEnemy.energy
123 | self.rect.left, self.rect.top = \
124 | randint(0, self.width - self.rect.width), \
125 | randint(-15 * self.height, -5 * self.height)
126 |
--------------------------------------------------------------------------------
/feiji/myplane.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 | import pygame
4 |
5 |
6 | class MyPlane(pygame.sprite.Sprite):
7 |
8 | def __init__(self, bg_size):
9 | pygame.sprite.Sprite.__init__(self)
10 | self.image = pygame.image.load("images/me1.png").convert_alpha()
11 | self.image1 = pygame.image.load("images/me2.png").convert_alpha()
12 | self.destroy_images = []
13 | self.destroy_images.extend([
14 | pygame.image.load("images/me_destroy_1.png").convert_alpha(),
15 | pygame.image.load("images/me_destroy_2.png").convert_alpha(),
16 | pygame.image.load("images/me_destroy_3.png").convert_alpha(),
17 | pygame.image.load("images/me_destroy_4.png").convert_alpha(),
18 | pygame.image.load("images/me_destroy_5.png").convert_alpha()
19 | ])
20 |
21 | self.rect = self.image.get_rect()
22 | self.width, self.height = bg_size[0], bg_size[1]
23 | self.rect.left, self.rect.top = \
24 | (self.width - self.rect.width) // 2, \
25 | self.height - self.rect.height - 60
26 | self.speed = 10
27 | self.active = True
28 | self.invincible = False
29 | self.mask = pygame.mask.from_surface(self.image1)
30 |
31 | def moveUp(self):
32 | if self.rect.top > 0:
33 | self.rect.top -= self.speed
34 | else:
35 | self.rect.top = 0
36 |
37 | def moveDown(self):
38 | if self.rect.bottom < self.height - 60:
39 | self.rect.top += self.speed
40 | else:
41 | self.rect.bottom = self.height - 60
42 |
43 | def moveLeft(self):
44 | if self.rect.left > 0:
45 | self.rect.left -= self.speed
46 | else:
47 | self.rect.left = 0
48 |
49 | def moveRight(self):
50 | if self.rect.right < self.width:
51 | self.rect.left += self.speed
52 | else:
53 | self.rect.right = self.width
54 |
55 | def reset(self):
56 | self.rect.left, self.rect.top = \
57 | (self.width - self.rect.width) // 2, \
58 | self.height - self.rect.height - 60
59 | self.active = True
60 | self.invincible = True
61 |
--------------------------------------------------------------------------------
/feiji/record.txt:
--------------------------------------------------------------------------------
1 | 2012000
--------------------------------------------------------------------------------
/feiji/screen.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 | import pygame
4 |
5 |
6 | class Background(pygame.sprite.Sprite):
7 |
8 | # 初始化地图
9 |
10 | def __init__(self, bg_size):
11 | pygame.sprite.Sprite.__init__(self)
12 |
13 | # 加载相同张图片资源,做交替实现地图滚动
14 | self.image1 = pygame.image.load(
15 | "images/background1.png").convert_alpha()
16 | self.image2 = pygame.image.load(
17 | "images/background1.png").convert_alpha()
18 | # 保存场景对象
19 | # self.bg_screen = bg_screen
20 | # 辅助移动地图
21 | self.y1 = 0
22 | self.y2 = -self.bg_size[1]
23 |
24 | # 计算地图图片绘制坐标
25 | def move(self):
26 | self.y1 = self.y1 + 1
27 | self.y2 = self.y2 + 1
28 | if self.y1 >= self.bg_size[1]:
29 | self.y1 = 0
30 | if self.y2 >= 0:
31 | self.y2 = -self.bg_size[1]
32 | self.blit(self.image1, (0, self.y1))
33 | self.blit(self.image2, (0, self.y2))
34 |
35 | # 绘制地图的两张图片
36 |
--------------------------------------------------------------------------------
/feiji/setting.py:
--------------------------------------------------------------------------------
1 | import os
2 | import pygame
3 |
4 | BASE_DIR =os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
5 |
6 | pygame.init() # 游戏初始化
7 | pygame.mixer.init() # 混音器初始化
8 |
9 | pygame.mixer.music.load("sound/game_music.ogg")
10 | pygame.mixer.music.set_volume(0.2)
11 | bullet_sound = pygame.mixer.Sound("sound/bullet.wav")
12 | bullet_sound.set_volume(0.2)
13 | bomb_sound = pygame.mixer.Sound("sound/use_bomb.wav")
14 | bomb_sound.set_volume(0.2)
15 | supply_sound = pygame.mixer.Sound("sound/supply.wav")
16 | supply_sound.set_volume(0.2)
17 | get_bomb_sound = pygame.mixer.Sound("sound/get_bomb.wav")
18 | get_bomb_sound.set_volume(0.2)
19 | get_bullet_sound = pygame.mixer.Sound("sound/get_bullet.wav")
20 | get_bullet_sound.set_volume(0.2)
21 | upgrade_sound = pygame.mixer.Sound("sound/upgrade.wav")
22 | upgrade_sound.set_volume(0.2)
23 | enemy3_fly_sound = pygame.mixer.Sound("sound/enemy3_flying.wav")
24 | enemy3_fly_sound.set_volume(0.2)
25 | enemy1_down_sound = pygame.mixer.Sound("sound/enemy1_down.wav")
26 | enemy1_down_sound.set_volume(0.2)
27 | enemy2_down_sound = pygame.mixer.Sound("sound/enemy2_down.wav")
28 | enemy2_down_sound.set_volume(0.2)
29 | enemy3_down_sound = pygame.mixer.Sound("sound/enemy3_down.wav")
30 | enemy3_down_sound.set_volume(0.5)
31 | me_down_sound = pygame.mixer.Sound("sound/me_down.wav")
32 | me_down_sound.set_volume(0.2)
--------------------------------------------------------------------------------
/feiji/start.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | # Form implementation generated from reading ui file 'document_up_down.ui'
5 | #
6 | # Created by: PyQt5 UI code generator 5.11.2
7 | #
8 | # WARNING! All changes made in this file will be lost!
9 |
10 | from PyQt5 import QtCore, QtGui, QtWidgets
11 |
12 | import os
13 |
14 | path2 = "feiji-background_1.png"
15 |
16 |
17 | class Ui_MainWindow_file(object):
18 |
19 | def setupUi(self, MainWindow):
20 | MainWindow.setObjectName("MainWindow")
21 | MainWindow.resize(415, 600)
22 |
23 | self.centralwidget = QtWidgets.QWidget(MainWindow)
24 | self.centralwidget.setObjectName("centralwidget")
25 |
26 | self.pushButton = QtWidgets.QPushButton(self.centralwidget)
27 | self.pushButton.setGeometry(QtCore.QRect(150, 230, 111, 51))
28 | self.pushButton.setObjectName("pushButton")
29 | self.pushButton.setStyleSheet("QPushButton{background-color:black;\
30 | color: white; border-radius: 10px; border: 2px groove gray;\
31 | border-style: outset;}"
32 | "QPushButton:hover{background-color:white; color: black;}"
33 | "QPushButton:pressed{background-color:rgb(85, 170, 255);\
34 | border-style: inset; }")
35 |
36 | MainWindow.setCentralWidget(self.centralwidget)
37 | self.menubar = QtWidgets.QMenuBar(MainWindow)
38 | self.menubar.setGeometry(QtCore.QRect(0, 0, 415, 23))
39 | self.menubar.setObjectName("menubar")
40 | MainWindow.setMenuBar(self.menubar)
41 | self.statusbar = QtWidgets.QStatusBar(MainWindow)
42 | self.statusbar.setObjectName("statusbar")
43 |
44 | self.retranslateUi(MainWindow)
45 | QtCore.QMetaObject.connectSlotsByName(MainWindow)
46 |
47 | # 信号槽
48 | self.pushButton.clicked.connect(self.show_main)
49 |
50 | def show_main(self):
51 | MainWindow.close()
52 | os.system("python ./feiji/main.py")
53 |
54 | def retranslateUi(self, MainWindow):
55 | _translate = QtCore.QCoreApplication.translate
56 | MainWindow.setStyleSheet("border-image:url(%s)" % path2)
57 | MainWindow.setWindowTitle(_translate("MainWindow", "游戏中"))
58 | self.pushButton.setText(_translate("MainWindow", "开始游戏"))
59 |
60 | if __name__ == "__main__":
61 | import sys
62 | app = QtWidgets.QApplication(sys.argv)
63 | MainWindow = QtWidgets.QMainWindow()
64 | ui = Ui_MainWindow_file()
65 | ui.setupUi(MainWindow)
66 | MainWindow.show()
67 | sys.exit(app.exec_())
68 |
--------------------------------------------------------------------------------
/feiji/supply.py:
--------------------------------------------------------------------------------
1 | import pygame
2 | from random import *
3 |
4 | class Bullet_Supply(pygame.sprite.Sprite):
5 | def __init__(self, bg_size):
6 | pygame.sprite.Sprite.__init__(self)
7 |
8 | self.image = pygame.image.load("images/bullet_supply.png").convert_alpha()
9 | self.rect = self.image.get_rect()
10 | self.width, self.height = bg_size[0], bg_size[1]
11 | self.rect.left, self.rect.bottom = \
12 | randint(0, self.width - self.rect.width), -100
13 | self.speed = 5
14 | self.active = False
15 | self.mask = pygame.mask.from_surface(self.image)
16 |
17 | def move(self):
18 | if self.rect.top < self.height:
19 | self.rect.top += self.speed
20 | else:
21 | self.active = False
22 |
23 | def reset(self):
24 | self.active = True
25 | self.rect.left, self.rect.bottom = \
26 | randint(0, self.width - self.rect.width), -100
27 |
28 | class Bomb_Supply(pygame.sprite.Sprite):
29 | def __init__(self, bg_size):
30 | pygame.sprite.Sprite.__init__(self)
31 |
32 | self.image = pygame.image.load("images/bomb_supply.png").convert_alpha()
33 | self.rect = self.image.get_rect()
34 | self.width, self.height = bg_size[0], bg_size[1]
35 | self.rect.left, self.rect.bottom = \
36 | randint(0, self.width - self.rect.width), -100
37 | self.speed = 5
38 | self.active = False
39 | self.mask = pygame.mask.from_surface(self.image)
40 |
41 | def move(self):
42 | if self.rect.top < self.height:
43 | self.rect.top += self.speed
44 | else:
45 | self.active = False
46 |
47 | def reset(self):
48 | self.active = True
49 | self.rect.left, self.rect.bottom = \
50 | randint(0, self.width - self.rect.width), -100
51 |
--------------------------------------------------------------------------------
/images/1.0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/1.0.png
--------------------------------------------------------------------------------
/images/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/1.png
--------------------------------------------------------------------------------
/images/2-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/2-1.png
--------------------------------------------------------------------------------
/images/2-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/2-2.png
--------------------------------------------------------------------------------
/images/2-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/2-3.png
--------------------------------------------------------------------------------
/images/2-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/2-4.png
--------------------------------------------------------------------------------
/images/2-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/2-5.png
--------------------------------------------------------------------------------
/images/2-6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/2-6.png
--------------------------------------------------------------------------------
/images/2-7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/2-7.png
--------------------------------------------------------------------------------
/images/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/2.png
--------------------------------------------------------------------------------
/images/3-0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/3-0.png
--------------------------------------------------------------------------------
/images/3-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/3-1.png
--------------------------------------------------------------------------------
/images/3-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/3-2.png
--------------------------------------------------------------------------------
/images/3-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/3-3.png
--------------------------------------------------------------------------------
/images/3-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/3-4.png
--------------------------------------------------------------------------------
/images/3-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/3-5.png
--------------------------------------------------------------------------------
/images/3-6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/3-6.png
--------------------------------------------------------------------------------
/images/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/3.png
--------------------------------------------------------------------------------
/images/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/4.png
--------------------------------------------------------------------------------
/images/Chat - 副本.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/Chat - 副本.jpg
--------------------------------------------------------------------------------
/images/Chat.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/Chat.jpg
--------------------------------------------------------------------------------
/images/Chat.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/Chat.psd
--------------------------------------------------------------------------------
/images/Chat_08.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/Chat_08.gif
--------------------------------------------------------------------------------
/images/Chat_09.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/Chat_09.gif
--------------------------------------------------------------------------------
/images/Chat_10.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/Chat_10.gif
--------------------------------------------------------------------------------
/images/Chat_11.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/Chat_11.gif
--------------------------------------------------------------------------------
/images/a4-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/a4-1.png
--------------------------------------------------------------------------------
/images/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/add.png
--------------------------------------------------------------------------------
/images/add0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/add0.jpg
--------------------------------------------------------------------------------
/images/again.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/again.png
--------------------------------------------------------------------------------
/images/avatar0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/avatar0.jpg
--------------------------------------------------------------------------------
/images/avatar1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/avatar1.jpg
--------------------------------------------------------------------------------
/images/avatar2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/avatar2.jpg
--------------------------------------------------------------------------------
/images/avatar3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/avatar3.jpg
--------------------------------------------------------------------------------
/images/avatar4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/avatar4.jpg
--------------------------------------------------------------------------------
/images/back1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/back1.png
--------------------------------------------------------------------------------
/images/background1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/background1.png
--------------------------------------------------------------------------------
/images/background2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/background2.png
--------------------------------------------------------------------------------
/images/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/bg.jpg
--------------------------------------------------------------------------------
/images/bomb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/bomb.png
--------------------------------------------------------------------------------
/images/bomb_supply.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/bomb_supply.png
--------------------------------------------------------------------------------
/images/boss.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/boss.png
--------------------------------------------------------------------------------
/images/boss1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/boss1.png
--------------------------------------------------------------------------------
/images/boss2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/boss2.png
--------------------------------------------------------------------------------
/images/boss3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/boss3.png
--------------------------------------------------------------------------------
/images/boss4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/boss4.png
--------------------------------------------------------------------------------
/images/boss5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/boss5.png
--------------------------------------------------------------------------------
/images/boss6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/boss6.png
--------------------------------------------------------------------------------
/images/boss7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/boss7.png
--------------------------------------------------------------------------------
/images/boss8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/boss8.png
--------------------------------------------------------------------------------
/images/btn_quit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/btn_quit.png
--------------------------------------------------------------------------------
/images/btn_quithover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/btn_quithover.png
--------------------------------------------------------------------------------
/images/btn_send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/btn_send.png
--------------------------------------------------------------------------------
/images/btn_sendhover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/btn_sendhover.png
--------------------------------------------------------------------------------
/images/bullet1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/bullet1.png
--------------------------------------------------------------------------------
/images/bullet2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/bullet2.png
--------------------------------------------------------------------------------
/images/bullet_supply.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/bullet_supply.png
--------------------------------------------------------------------------------
/images/file.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/file.jpg
--------------------------------------------------------------------------------
/images/file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/file.png
--------------------------------------------------------------------------------
/images/file0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/file0.jpg
--------------------------------------------------------------------------------
/images/game.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/game.png
--------------------------------------------------------------------------------
/images/gameover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/gameover.png
--------------------------------------------------------------------------------
/images/hongzhaji.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/hongzhaji.png
--------------------------------------------------------------------------------
/images/image_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/image_1.jpg
--------------------------------------------------------------------------------
/images/image_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/image_2.jpg
--------------------------------------------------------------------------------
/images/image_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/image_3.jpg
--------------------------------------------------------------------------------
/images/image_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/image_4.jpg
--------------------------------------------------------------------------------
/images/image_5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/image_5.jpg
--------------------------------------------------------------------------------
/images/img_cloud_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/img_cloud_1.png
--------------------------------------------------------------------------------
/images/img_cloud_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/img_cloud_2.png
--------------------------------------------------------------------------------
/images/info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/info.png
--------------------------------------------------------------------------------
/images/life.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/life.png
--------------------------------------------------------------------------------
/images/login.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/login.psd
--------------------------------------------------------------------------------
/images/me1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/me1.png
--------------------------------------------------------------------------------
/images/me2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/me2.png
--------------------------------------------------------------------------------
/images/me_destroy_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/me_destroy_1.png
--------------------------------------------------------------------------------
/images/me_destroy_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/me_destroy_2.png
--------------------------------------------------------------------------------
/images/me_destroy_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/me_destroy_3.png
--------------------------------------------------------------------------------
/images/me_destroy_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/me_destroy_4.png
--------------------------------------------------------------------------------
/images/me_destroy_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/me_destroy_5.png
--------------------------------------------------------------------------------
/images/pause_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/pause_nor.png
--------------------------------------------------------------------------------
/images/pause_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/pause_pressed.png
--------------------------------------------------------------------------------
/images/resume_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/resume_nor.png
--------------------------------------------------------------------------------
/images/resume_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/resume_pressed.png
--------------------------------------------------------------------------------
/images/shuaxin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/shuaxin.png
--------------------------------------------------------------------------------
/images/timg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/timg.jpg
--------------------------------------------------------------------------------
/images/upfile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/images/upfile.png
--------------------------------------------------------------------------------
/module/__pycache__/connectDB.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/module/__pycache__/connectDB.cpython-36.pyc
--------------------------------------------------------------------------------
/module/__pycache__/haoyou_select.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/module/__pycache__/haoyou_select.cpython-36.pyc
--------------------------------------------------------------------------------
/module/__pycache__/items.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/module/__pycache__/items.cpython-36.pyc
--------------------------------------------------------------------------------
/module/__pycache__/mysqlRoot.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/module/__pycache__/mysqlRoot.cpython-36.pyc
--------------------------------------------------------------------------------
/module/__pycache__/pushbutton.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/module/__pycache__/pushbutton.cpython-36.pyc
--------------------------------------------------------------------------------
/module/__pycache__/turles1.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/module/__pycache__/turles1.cpython-36.pyc
--------------------------------------------------------------------------------
/module/__pycache__/two.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/module/__pycache__/two.cpython-36.pyc
--------------------------------------------------------------------------------
/module/__pycache__/zc2.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/module/__pycache__/zc2.cpython-36.pyc
--------------------------------------------------------------------------------
/module/haoyou.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | # Form implementation generated from reading ui file 'haoyou.ui'
5 | #
6 | # Created by: PyQt5 UI code generator 5.11.2
7 | #
8 | # WARNING! All changes made in this file will be lost!
9 |
10 | from PyQt5 import QtCore, QtGui, QtWidgets
11 | import pymysql
12 |
13 |
14 | class Ui_MainWindow(QtWidgets.QWidget):
15 |
16 | def setupUi(self, MainWindow):
17 | MainWindow.setObjectName("MainWindow")
18 | MainWindow.resize(381, 325)
19 | self.centralwidget = QtWidgets.QWidget(MainWindow)
20 | self.centralwidget.setObjectName("centralwidget")
21 |
22 | self.lineEdit = QtWidgets.QLineEdit(self.centralwidget)
23 | self.lineEdit.setGeometry(QtCore.QRect(30, 50, 221, 31))
24 | self.lineEdit.setObjectName("lineEdit")
25 |
26 | self.pushButton = QtWidgets.QPushButton(self.centralwidget)
27 | self.pushButton.setGeometry(QtCore.QRect(280, 50, 72, 30))
28 | self.pushButton.setObjectName("pushButton")
29 | self.pushButton.clicked.connect(self.findId)
30 |
31 | self.textBrowser = QtWidgets.QTextBrowser(self.centralwidget)
32 | self.textBrowser.setGeometry(QtCore.QRect(30, 120, 321, 131))
33 | self.textBrowser.setObjectName("textBrowser")
34 | self.lineEdit.setPlaceholderText("请输入ID")
35 |
36 | MainWindow.setCentralWidget(self.centralwidget)
37 | self.menubar = QtWidgets.QMenuBar(MainWindow)
38 | self.menubar.setGeometry(QtCore.QRect(0, 0, 381, 23))
39 | self.menubar.setObjectName("menubar")
40 | MainWindow.setMenuBar(self.menubar)
41 | self.statusbar = QtWidgets.QStatusBar(MainWindow)
42 | self.statusbar.setObjectName("statusbar")
43 | MainWindow.setStatusBar(self.statusbar)
44 |
45 | self.retranslateUi(MainWindow)
46 | QtCore.QMetaObject.connectSlotsByName(MainWindow)
47 |
48 | def findId(self):
49 | self.textBrowser.clear()
50 | ID = self.lineEdit.text()
51 | db = pymysql.connect("localhost", "root", "123456")
52 | cursor = db.cursor()
53 | cursor.execute("use rootdb;")
54 | cursor.execute(
55 | "select rootname,nickname,address from users where rootname = %s;" % ID)
56 | data = list(cursor.fetchall())
57 | if data == []:
58 | self.textBrowser.append('查无此人')
59 | else:
60 | s = '账号 昵称 地址\n'
61 | for i in data[0]:
62 | s += str(i) + ' '
63 | self.textBrowser.append(s)
64 | cursor.execute(
65 | "insert into friends(rootname,f_rootname) values (%s,%s);" % (113564098, ID))
66 | db.commit()
67 |
68 | def retranslateUi(self, MainWindow):
69 | _translate = QtCore.QCoreApplication.translate
70 | MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
71 | self.pushButton.setText(_translate("MainWindow", "查找"))
72 |
73 | if __name__ == "__main__":
74 | import sys
75 | app = QtWidgets.QApplication(sys.argv)
76 | MainWindow = QtWidgets.QMainWindow()
77 | ui = Ui_MainWindow()
78 | ui.setupUi(MainWindow)
79 | MainWindow.show()
80 | sys.exit(app.exec_())
81 |
--------------------------------------------------------------------------------
/module/haoyou_select.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | # Form implementation generated from reading ui file 'document_up_down.ui'
5 | #
6 | # Created by: PyQt5 UI code generator 5.11.2
7 | #
8 | # WARNING! All changes made in this file will be lost!
9 |
10 | from PyQt5 import QtCore, QtGui, QtWidgets
11 |
12 | # from xiazai import Ui_MainWindow
13 |
14 |
15 | class Ui_ADD(QtWidgets.QMainWindow):
16 |
17 | def __init__(self, my_info, s):
18 | super().__init__()
19 | self.setupUi(self)
20 | self.my_info = my_info
21 | self.s = s
22 |
23 | def setupUi(self, MainWindow):
24 | MainWindow.setObjectName("MainWindow")
25 | MainWindow.resize(381, 325)
26 | self.centralwidget = QtWidgets.QWidget(MainWindow)
27 | self.centralwidget.setObjectName("centralwidget")
28 |
29 | self.lineEdit = QtWidgets.QLineEdit(self.centralwidget)
30 | self.lineEdit.setGeometry(QtCore.QRect(30, 50, 221, 31))
31 | self.lineEdit.setObjectName("lineEdit")
32 | self.pushButton = QtWidgets.QPushButton(self.centralwidget)
33 | self.pushButton.setGeometry(QtCore.QRect(255, 50, 50, 30))
34 | self.pushButton.setObjectName("pushButton")
35 | self.pushButton.clicked.connect(self.findId)
36 |
37 | self.pushButton1 = QtWidgets.QPushButton(self.centralwidget)
38 | self.pushButton1.setGeometry(QtCore.QRect(300, 50, 50, 30))
39 | self.pushButton1.setObjectName("pushButton")
40 | self.pushButton1.clicked.connect(self.delId)
41 |
42 |
43 | self.textBrowser = QtWidgets.QTextBrowser(self.centralwidget)
44 | self.textBrowser.setGeometry(QtCore.QRect(30, 120, 321, 131))
45 | self.textBrowser.setObjectName("textBrowser")
46 | self.lineEdit.setPlaceholderText("请输入ID")
47 | MainWindow.setCentralWidget(self.centralwidget)
48 | self.menubar = QtWidgets.QMenuBar(MainWindow)
49 | self.menubar.setGeometry(QtCore.QRect(0, 0, 381, 23))
50 | self.menubar.setObjectName("menubar")
51 | MainWindow.setMenuBar(self.menubar)
52 | self.statusbar = QtWidgets.QStatusBar(MainWindow)
53 | self.statusbar.setObjectName("statusbar")
54 | MainWindow.setStatusBar(self.statusbar)
55 |
56 | self.retranslateUi(MainWindow)
57 | QtCore.QMetaObject.connectSlotsByName(MainWindow)
58 |
59 | def recvinfo(self,data):
60 | if data == "nois":
61 | self.textBrowser.append('查无此人')
62 | else:
63 | self.textBrowser.append("好友添加成功")
64 |
65 | def recvinfo1(self,data):
66 | if data == "nois":
67 | self.textBrowser.append('查无此人')
68 | else:
69 | self.textBrowser.append("好友删除成功")
70 |
71 | def findId(self):
72 | self.textBrowser.clear()
73 | ID = self.lineEdit.text()
74 | self.s.send(("F"+ " " + self.my_info["rootname"] + " " + ID).encode())
75 |
76 | def delId(self):
77 | self.textBrowser.clear()
78 | ID = self.lineEdit.text()
79 | self.s.send(("V"+ " " + self.my_info["rootname"] + " " + ID).encode())
80 |
81 |
82 | def retranslateUi(self, MainWindow):
83 | _translate = QtCore.QCoreApplication.translate
84 | MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
85 | self.pushButton.setText(_translate("MainWindow", "添加"))
86 | self.pushButton1.setText(_translate("MainWindow", "删除"))
87 |
--------------------------------------------------------------------------------
/module/items - 副本.py:
--------------------------------------------------------------------------------
1 | from PyQt5.QtWidgets import (QWidget, QLabel, QApplication, QPushButton, QVBoxLayout,
2 | QHBoxLayout, QListWidget, QListWidgetItem,QMenu,QAction)
3 |
4 | from PyQt5.QtCore import QSize, Qt
5 | from PyQt5.QtGui import QPixmap, QFont
6 |
7 | from PyQt5.QtGui import QCursor
8 | from PyQt5.QtCore import QPoint
9 |
10 | class MyLable(QWidget):
11 | def __init__(self, title, subtitle, icon_path):
12 | super(MyLable, self).__init__()
13 | self.lb_title = QLabel(title)
14 | self.lb_title.setFont(QFont("Arial", 10, QFont.Bold))
15 | self.lb_subtitle = QLabel(subtitle)
16 | self.lb_subtitle.setFont(QFont("Arial", 8, QFont.StyleItalic))
17 | self.lb_icon = QLabel()
18 | self.lb_icon.setFixedSize(40, 40)
19 | pixMap = QPixmap(icon_path).scaled(self.lb_icon.width(), self.lb_icon.height())
20 | self.lb_icon.setPixmap(pixMap)
21 | self.double_click_fun = None
22 | self.init_ui()
23 |
24 |
25 | def init_ui(self):
26 | """handle layout"""
27 | ly_main = QHBoxLayout()
28 | ly_right = QVBoxLayout()
29 | ly_right.addWidget(self.lb_title)
30 | ly_right.addWidget(self.lb_subtitle)
31 | ly_right.setAlignment(Qt.AlignVCenter)
32 | ly_main.addWidget(self.lb_icon)
33 | ly_main.addLayout(ly_right)
34 | self.setLayout(ly_main)
35 | self.resize(90, 60)
36 |
37 | def get_lb_title(self):
38 | return self.lb_title.text()
39 |
40 | def get_lb_subtitle(self):
41 | return self.lb_subtitle.text()
42 |
43 | class ListWindow(QWidget):
44 | def __init__(self, parent=None):
45 | super(ListWindow, self).__init__(parent)
46 | self.doubleclick_fun = None
47 | self.list_widget = QListWidget()
48 |
49 |
50 |
51 |
52 | def _set_items(self, list_text):
53 | self.list_widget.clear()
54 | ly_vbox = QVBoxLayout()
55 | print("set_items>",list_text)
56 | for item in list_text:
57 | self._setItem(item[0], str(item[1]), item[2])
58 | ly_vbox.addWidget(self.list_widget)
59 | self.list_widget.itemClicked.connect(self.item_doubleclick_slot)
60 |
61 | self.setLayout(ly_vbox)
62 |
63 |
64 |
65 |
66 | def _setItem(self, title, subtitle, pic_path):
67 | item_widget = QListWidgetItem()
68 | item_widget.setSizeHint(QSize(90, 60))
69 | self.list_widget.addItem(item_widget)
70 |
71 | label = MyLable(title, subtitle, pic_path)
72 | self.list_widget.setItemWidget(item_widget, label)
73 |
74 |
75 | def item_doubleclick_slot(self):
76 | if self.doubleclick_fun:
77 | widget = self.list_widget.itemWidget(self.list_widget.currentItem()) # get MyLabel widget
78 | self.doubleclick_fun(widget.get_lb_title(), widget.get_lb_subtitle())
79 |
80 | def set_doubleclick_slot(self, fun):
81 | """set item double click slot"""
82 | self.doubleclick_fun = fun
83 |
84 |
85 |
--------------------------------------------------------------------------------
/module/items.py:
--------------------------------------------------------------------------------
1 | from PyQt5.QtWidgets import (QWidget, QLabel, QApplication, QPushButton, QVBoxLayout,
2 | QHBoxLayout, QListWidget, QListWidgetItem,QMenu,QAction)
3 |
4 | from PyQt5.QtCore import QSize, Qt
5 | from PyQt5.QtGui import QPixmap, QFont
6 |
7 | from PyQt5.QtGui import QCursor
8 | from PyQt5.QtCore import QPoint
9 |
10 | class MyLable(QWidget):
11 | def __init__(self, title, subtitle, icon_path):
12 | super(MyLable, self).__init__()
13 | self.lb_title = QLabel(title)
14 | self.lb_title.setFont(QFont("Arial", 10, QFont.Bold))
15 | self.lb_subtitle = QLabel(subtitle)
16 | self.lb_subtitle.setFont(QFont("Arial", 8, QFont.StyleItalic))
17 | self.lb_icon = QLabel()
18 | self.lb_icon.setFixedSize(40, 40)
19 | pixMap = QPixmap(icon_path).scaled(self.lb_icon.width(), self.lb_icon.height())
20 | self.lb_icon.setPixmap(pixMap)
21 | self.double_click_fun = None
22 | self.init_ui()
23 |
24 |
25 | def init_ui(self):
26 | """handle layout"""
27 | ly_main = QHBoxLayout()
28 | ly_right = QVBoxLayout()
29 | ly_right.addWidget(self.lb_title)
30 | ly_right.addWidget(self.lb_subtitle)
31 | ly_right.setAlignment(Qt.AlignVCenter)
32 | ly_main.addWidget(self.lb_icon)
33 | ly_main.addLayout(ly_right)
34 | self.setLayout(ly_main)
35 | self.resize(90, 60)
36 |
37 | def get_lb_title(self):
38 | return self.lb_title.text()
39 |
40 | def get_lb_subtitle(self):
41 | return self.lb_subtitle.text()
42 |
43 | class ListWindow(QWidget):
44 | def __init__(self, parent=None):
45 | super(ListWindow, self).__init__(parent)
46 | self.doubleclick_fun = None
47 | self.list_widget = QListWidget()
48 |
49 |
50 |
51 |
52 | def _set_items(self, list_text):
53 | self.list_widget.clear()
54 | ly_vbox = QVBoxLayout()
55 | print("set_items>",list_text)
56 | for item in list_text:
57 | self._setItem(item[0], str(item[1]), item[2])
58 | ly_vbox.addWidget(self.list_widget)
59 | self.list_widget.itemClicked.connect(self.item_doubleclick_slot)
60 | self.list_widget.customContextMenuRequested[QPoint].connect(self.myListWidgetContext)
61 | self.list_widget.setContextMenuPolicy(Qt.CustomContextMenu)
62 | self.setLayout(ly_vbox)
63 |
64 | def getListitems(self):
65 | return self.selectedItems()
66 |
67 | def myListWidgetContext(self, point):
68 | popMenu = QMenu()
69 | popMenu.addAction(QAction(u'添加', self, triggered=self.close))
70 | popMenu.addAction(QAction(u'删除', self, triggered=self.addItem))
71 | popMenu.addAction(QAction(u'修改', self, triggered=self.close))
72 |
73 | popMenu.exec_(QCursor.pos())
74 |
75 | def addItem(self):
76 | print("执行了删除")
77 | L = [["1","1","avatar.jpg"],["1","1","avatar.jpg"]]
78 | self._set_items(L)
79 |
80 |
81 | def _setItem(self, title, subtitle, pic_path):
82 | item_widget = QListWidgetItem()
83 | item_widget.setSizeHint(QSize(90, 60))
84 | self.list_widget.addItem(item_widget)
85 |
86 | label = MyLable(title, subtitle, pic_path)
87 | self.list_widget.setItemWidget(item_widget, label)
88 |
89 |
90 | def item_doubleclick_slot(self):
91 | if self.doubleclick_fun:
92 | widget = self.list_widget.itemWidget(self.list_widget.currentItem()) # get MyLabel widget
93 | self.doubleclick_fun(widget.get_lb_title(), widget.get_lb_subtitle())
94 |
95 | def set_doubleclick_slot(self, fun):
96 | """set item double click slot"""
97 | self.doubleclick_fun = fun
98 |
99 |
100 |
--------------------------------------------------------------------------------
/module/mysqlRoot.py:
--------------------------------------------------------------------------------
1 |
2 | from __future__ import unicode_literals
3 | import pymysql
4 |
5 |
6 | def creatConnect():
7 | conn = pymysql.connect(host="localhost", user="root",
8 | password="123456", db="RootDB", port=3306, charset="utf8")
9 | cur = conn.cursor()
10 | return (conn, cur)
11 |
12 |
13 | def close(conn, cur):
14 | cur.close()
15 | conn.close()
16 |
17 |
18 | def main():
19 | try:
20 | conn, cur = creatConnect()
21 | create_users(conn)
22 | create_friends(conn)
23 | create_history(conn)
24 | conn.commit()
25 | except:
26 | conn = pymysql.connect(host="localhost", user="root",
27 | password="123456", port=3306, charset="utf8")
28 | cur = conn.cursor()
29 | cur.execute('create database RootDB default character set utf8;')
30 | conn.commit()
31 | create_users(conn)
32 | create_friends(conn)
33 | create_history(conn)
34 | conn.commit()
35 | close(conn, cur)
36 |
37 |
38 | def create_users(conn):
39 | s = 'create table users(\
40 | id int auto_increment primary key,\
41 | rootname int,\
42 | nickname varchar(20),\
43 | pwd varchar(32),\
44 | gender enum("男","女","保密"),\
45 | tel varchar(11),\
46 | address varchar(100),\
47 | email varchar(30),\
48 | birthday varchar(15),\
49 | avatar text,\
50 | style varchar(100),\
51 | onlinestatus enum("在线","离线") default "离线",\
52 | time timestamp default now(),\
53 | last_online timestamp default now())character set utf8;'
54 | cur = conn.cursor()
55 | try:
56 | cur.execute(s)
57 | conn.commit()
58 | print('users ok')
59 | except:
60 | print("create_users FILL")
61 | conn.rollback()
62 |
63 |
64 | def insert_users(rootname, nickname, pwd, gender, tel, address, email, birthday, avatar, style, onlinestatus):
65 | conn, cur = creatConnect()
66 | s = '''insert into users
67 | (rootname, nickname, pwd, gender, tel, address, email, birthday, avatar, style, onlinestatus)
68 | values("%s","%s","%s","%s","%s","%s","%s","%s","%s","%s","%s")''' % (rootname, nickname, pwd, gender, tel, address, email, birthday, avatar, style, onlinestatus)
69 | try:
70 | cur.execute(s)
71 | conn.commit()
72 | print("insert_users is ok")
73 | except:
74 | print("insert_users FILL")
75 | conn.rollback()
76 | close(conn, cur)
77 |
78 |
79 | def updatestatus_users(rootname, status):
80 | conn, cur = creatConnect()
81 | s = "update users set onlinestatus='%s', last_online=now() where rootname='%s'" % (status, rootname)
82 | try:
83 | cur.execute(s)
84 | conn.commit()
85 | print("update_users is ok")
86 | except:
87 | print("updatestatus_users FILL")
88 | conn.rollback()
89 | close(conn, cur)
90 |
91 |
92 | def login(rootname, pwd):
93 | conn, cur = creatConnect()
94 | s = "select rootname,nickname,gender,tel,address,email,birthday,avatar,style,onlinestatus,last_online from users where rootname='%s' and pwd='%s'" % (rootname, pwd)
95 | cur.execute(s)
96 | data = cur.fetchone()
97 | close(conn, cur)
98 | return data
99 |
100 |
101 | def select_users(rootname):
102 | conn, cur = creatConnect()
103 | s = "select rootname,nickname,gender,tel,address,email,birthday,avatar,style,onlinestatus from users where rootname='%s'" % rootname
104 | cur.execute(s)
105 | data = cur.fetchone()
106 | close(conn, cur)
107 | return data
108 |
109 | def create_friends(conn):
110 | s = '''create table friends(
111 | id int auto_increment primary key,
112 | rootname int not null,
113 | f_rootname int not null)character set utf8;'''
114 | cur = conn.cursor()
115 | try:
116 | cur.execute(s)
117 | conn.commit()
118 | print('create_friends is ok')
119 | except:
120 | print("create_friends FILL")
121 | conn.rollback()
122 |
123 |
124 | def insert_friends(rootname, f_rootname):
125 | conn, cur = creatConnect()
126 | s = 'insert into friends(rootname,f_rootname) values("%s","%s"),("%s","%s")' % (
127 | rootname, f_rootname, f_rootname, rootname)
128 | try:
129 | cur.execute(s)
130 | conn.commit()
131 | print("insert_friends is ok")
132 | except Exception as e:
133 | print(e)
134 | conn.rollback()
135 | close(conn, cur)
136 |
137 | def delete_friends(rootname, f_rootname):
138 | conn, cur = creatConnect()
139 | s = 'delete from friends where (rootname="%s" and f_rootname="%s") or (rootname="%s" and f_rootname="%s")' %(
140 | rootname, f_rootname, f_rootname, rootname)
141 | try:
142 | cur.execute(s)
143 | conn.commit()
144 | print("delete_friends is ok")
145 | except Exception as e:
146 | print(e)
147 | conn.rollback()
148 | close(conn, cur)
149 |
150 | def select_friends(rootname):
151 | conn, cur = creatConnect()
152 | s = "select users.nickname, friends.f_rootname, users.avatar from friends,users where friends.rootname='%s' and users.rootname=friends.f_rootname;" % rootname
153 | cur.execute(s)
154 | data = cur.fetchall()
155 | close(conn, cur)
156 | return data
157 |
158 |
159 | def create_history(conn):
160 | s = '''create table history(
161 | id int auto_increment primary key,
162 | rootname int not null,
163 | f_rootname int not null,
164 | record text,
165 | time timestamp default now())character set utf8;'''
166 | cur = conn.cursor()
167 | try:
168 | cur.execute(s)
169 | conn.commit()
170 | print('create_history ok')
171 | except:
172 | print("create_history FILL")
173 | conn.rollback()
174 |
175 |
176 | def insert_history(rootname, f_rootname, record):
177 | conn, cur = creatConnect()
178 | print("history:",rootname, f_rootname)
179 | s = "insert into history(rootname, f_rootname, record) values('%s', '%s', '%s')" % (
180 | rootname, f_rootname, record)
181 | try:
182 | cur.execute(s)
183 | conn.commit()
184 | print("insert_hist is ok")
185 | except:
186 | print("insert_history FILL")
187 | conn.rollback()
188 | close(conn, cur)
189 |
190 |
191 | def select_history(rootname, f_rootname):
192 | conn, cur = creatConnect()
193 | s = "select record from history where ((rootname = '%s')and(f_rootname = '%s')) or (( f_rootname = '%s')and(rootname = '%s'))" % (
194 | rootname, f_rootname, f_rootname, rootname)
195 | cur.execute(s)
196 | data = cur.fetchall()
197 | close(conn, cur)
198 | return data
199 |
200 |
201 | def selectfive_history(rootname, f_rootname):
202 | conn, cur = creatConnect()
203 | s = "select record from history where (rootname = '%s' and f_rootname = '%s') or (rootname = '%s' and f_rootname = '%s') order by id desc limit 5;" % (
204 | rootname, f_rootname, f_rootname, rootname)
205 | cur.execute(s)
206 | data = cur.fetchall()
207 | close(conn, cur)
208 | return data
209 |
210 | def selectlast_online_history(last_online, rootname):
211 | conn, cur = creatConnect()
212 | print("mySQL>",last_online)
213 | s = "select record from history where time > ('%s') and f_rootname = '%s' order by rootname;" % (last_online, rootname)
214 | cur.execute(s)
215 | data = cur.fetchall()
216 | close(conn, cur)
217 | return data
218 |
219 |
--------------------------------------------------------------------------------
/module/pushbutton.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # Form implementation generated from reading ui file 'pushbutton.ui'
4 | #
5 | # Created by: PyQt5 UI code generator 5.11.2
6 | #
7 | # WARNING! All changes made in this file will be lost!
8 |
9 | from PyQt5 import QtCore, QtGui, QtWidgets
10 | from module.two import Ui_Two
11 |
12 |
13 | class Ui_Zhuce(QtWidgets.QMainWindow):
14 | def __init__(self, s):
15 | super().__init__()
16 | self.setupUi(self)
17 | self.s = s
18 |
19 | def setupUi(self, MainWindow):
20 | MainWindow.setObjectName("MainWindow")
21 | MainWindow.resize(525, 692)
22 | self.centralwidget = QtWidgets.QWidget(MainWindow)
23 | self.centralwidget.setObjectName("centralwidget")
24 | self.pushButton = QtWidgets.QPushButton(self.centralwidget)
25 | self.pushButton.setGeometry(QtCore.QRect(200, 580, 121, 41))
26 | self.pushButton.setObjectName("pushButton")
27 | self.label = QtWidgets.QLabel(self.centralwidget)
28 | self.label.setGeometry(QtCore.QRect(10, 30, 201, 20))
29 | self.label.setStyleSheet("font: 75 16pt \"华文新魏\";")
30 | self.label.setObjectName("label")
31 | self.textBrowser = QtWidgets.QTextBrowser(self.centralwidget)
32 | self.textBrowser.setGeometry(QtCore.QRect(70, 70, 391, 481))
33 | self.textBrowser.setObjectName("textBrowser")
34 | MainWindow.setCentralWidget(self.centralwidget)
35 | self.menubar = QtWidgets.QMenuBar(MainWindow)
36 | self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 23))
37 | self.menubar.setObjectName("menubar")
38 | MainWindow.setMenuBar(self.menubar)
39 | self.statusbar = QtWidgets.QStatusBar(MainWindow)
40 | self.statusbar.setObjectName("statusbar")
41 | MainWindow.setStatusBar(self.statusbar)
42 |
43 | self.retranslateUi(MainWindow)
44 | QtCore.QMetaObject.connectSlotsByName(MainWindow)
45 |
46 |
47 | #信号槽
48 | self.pushButton.clicked.connect(self.show_main)
49 |
50 | #读出文件注册须知
51 | def textB(self):
52 | print("textB")
53 | fd = open("./module/zhuce.txt")
54 | while True:
55 | f = fd.readline()
56 | self.textBrowser.append(f)
57 | if not f:
58 | break
59 |
60 |
61 | def show_main(self):
62 | self.hide()
63 | self.two = Ui_Two(self.s)
64 | self.two.show()
65 |
66 | def retranslateUi(self, MainWindow):
67 | _translate = QtCore.QCoreApplication.translate
68 | MainWindow.setWindowTitle(_translate("MainWindow", "注册"))
69 | self.pushButton.setText(_translate("MainWindow", "同意"))
70 | self.label.setText(_translate("MainWindow", "请仔细阅读以下条例:"))
71 |
72 |
--------------------------------------------------------------------------------
/module/turles1.py:
--------------------------------------------------------------------------------
1 | '''验证码生成器'''
2 | # import turtle
3 | # import time
4 | # turtle.color('red','yellow')
5 | # turtle.begin_fill()
6 | # for _ in range(50):
7 | # turtle.forward(200)
8 | # turtle.left(170)
9 | # turtle.end_fill()
10 | # turtle.mainloop()
11 | import os
12 | import pygame
13 | from pygame.locals import *
14 | from random import *
15 |
16 | def yanzhengma():
17 | pygame.init()
18 | l = ['r','o','o','t','a',1,2,3,4,5,6,7,8,9,0]
19 | R = sample(l,4)
20 | # print(R)
21 | text = u'%s'%R
22 | # print(text)
23 | font = pygame.font.SysFont('Microsoft YaHei',64)
24 | ftext = font.render(text,True,(65,83,130),(255,255,255))
25 |
26 | pygame.image.save(ftext,'./yanzhengma.png')
27 |
28 | return R
29 |
--------------------------------------------------------------------------------
/module/zc2.py:
--------------------------------------------------------------------------------
1 | from PyQt5 import QtCore, QtGui, QtWidgets
2 | from PyQt5.QtWidgets import QLineEdit
3 | from PyQt5.QtWidgets import *
4 | from PyQt5.QtCore import *
5 | from module.turles1 import *
6 | import random
7 | from PyQt5.QtCore import Qt, QEvent, QRegExp
8 | from PyQt5.QtGui import QKeyEvent, QKeySequence, QRegExpValidator
9 | import module.mysqlRoot as Conn
10 | import time
11 | import json
12 |
13 | class Ui_ZC2(QtWidgets.QMainWindow):
14 |
15 | def __init__(self,L,T,W,text1,s):
16 | super().__init__()
17 | self.setupUi(self)
18 | self.L = L
19 | self.T = T
20 | self.W = W
21 | self.text = text1
22 | self.s = s
23 |
24 | def setupUi(self, MainWindow):
25 |
26 | path2 = "./zc/test-1.png"
27 | MainWindow.setObjectName("MainWindow")
28 | MainWindow.resize(523, 556)
29 | MainWindow.setStyleSheet("background-image:url(%s)" % path2)
30 |
31 | self.centralwidget = QtWidgets.QWidget(MainWindow)
32 | self.centralwidget.setObjectName("centralwidget")
33 |
34 | self.label = QtWidgets.QLabel(self.centralwidget)
35 | self.label.setGeometry(QtCore.QRect(30, 40, 81, 31))
36 | font = QtGui.QFont()
37 | font.setPointSize(20)
38 | font.setBold(True)
39 | font.setWeight(75)
40 | self.label.setFont(font)
41 | self.label.setObjectName("label")
42 | self.label_2 = QtWidgets.QLabel(self.centralwidget)
43 | self.label_2.setGeometry(QtCore.QRect(100, 140, 71, 31))
44 | font = QtGui.QFont()
45 | font.setPointSize(13)
46 | self.label_2.setFont(font)
47 | self.label_2.setObjectName("label_2")
48 | self.label_3 = QtWidgets.QLabel(self.centralwidget)
49 | self.label_3.setGeometry(QtCore.QRect(90, 80, 401, 16))
50 | font = QtGui.QFont()
51 | font.setPointSize(13)
52 | font.setBold(True)
53 | font.setWeight(75)
54 | self.label_3.setFont(font)
55 | self.label_3.setObjectName("label_3")
56 | self.label_5 = QtWidgets.QLabel(self.centralwidget)
57 | self.label_5.setGeometry(QtCore.QRect(130, 240, 54, 21))
58 | font = QtGui.QFont()
59 | font.setPointSize(13)
60 | font.setBold(True)
61 | font.setWeight(75)
62 | self.label_5.setFont(font)
63 | self.label_5.setObjectName("label_5")
64 | self.pwText = QtWidgets.QLineEdit(self.centralwidget)
65 | self.pwText.setGeometry(QtCore.QRect(180, 240, 191, 20))
66 | self.pwText.setStyleSheet("style={\n"
67 | "placeholder=\"请输入密码\"\n"
68 | "}")
69 | self.pwText.setObjectName("pwText")
70 | self.pwText.setPlaceholderText("密码6-15位,只能有数字和字母")
71 | self.pwText.setEchoMode(QLineEdit.Password)
72 | regx = QRegExp("[0-9A-Za-z]{14}$")
73 | validator = QRegExpValidator(regx, self.pwText)
74 | self.pwText.setValidator(validator)
75 |
76 |
77 | self.label_6 = QtWidgets.QLabel(self.centralwidget)
78 | self.label_6.setGeometry(QtCore.QRect(93, 290, 91, 21))
79 | font = QtGui.QFont()
80 | font.setPointSize(13)
81 | font.setBold(True)
82 | font.setWeight(75)
83 | self.label_6.setFont(font)
84 | self.label_6.setObjectName("label_6")
85 | self.pwText_2 = QtWidgets.QLineEdit(self.centralwidget)
86 | self.pwText_2.setGeometry(QtCore.QRect(180, 290, 191, 20))
87 | self.pwText_2.setStyleSheet("placeholder:“密码由6-20位数字或字母组成”;")
88 | self.pwText_2.setObjectName("pwText_2")
89 | self.pwText_2.setEchoMode(QLineEdit.Password)
90 | regx = QRegExp("[0-9A-Za-z]{14}")
91 | validator = QRegExpValidator(regx, self.pwText_2)
92 | self.pwText_2.setValidator(validator)
93 |
94 |
95 | self.randomText = QtWidgets.QLabel(self.centralwidget)
96 | self.randomText.setGeometry(QtCore.QRect(240, 160, 221, 16))
97 | self.randomText.setText("")
98 | self.randomText.setObjectName("randomText")
99 | self.liButton = QtWidgets.QCommandLinkButton(self.centralwidget)
100 | self.liButton.setGeometry(QtCore.QRect(180, 330, 185, 41))
101 | self.liButton.setObjectName("liButton")
102 | self.textBrowser = QtWidgets.QTextBrowser(self.centralwidget)
103 | self.textBrowser.setGeometry(QtCore.QRect(170, 130, 201, 51))
104 | self.textBrowser.setStyleSheet("font: 75 italic 24pt \"幼圆\";\n"
105 | "background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(145, 241, 249, 255), stop:1 rgba(255, 255, 255, 255));")
106 | self.textBrowser.setObjectName("textBrowser")
107 | MainWindow.setCentralWidget(self.centralwidget)
108 | self.menubar = QtWidgets.QMenuBar(MainWindow)
109 | self.menubar.setGeometry(QtCore.QRect(0, 0, 523, 23))
110 | self.menubar.setObjectName("menubar")
111 | MainWindow.setMenuBar(self.menubar)
112 | self.statusbar = QtWidgets.QStatusBar(MainWindow)
113 | self.statusbar.setObjectName("statusbar")
114 | MainWindow.setStatusBar(self.statusbar)
115 |
116 | self.textBrowser_2 = QtWidgets.QTextBrowser(self.centralwidget)
117 | self.textBrowser_2.setGeometry(QtCore.QRect(380, 280, 131, 41))
118 | font = QtGui.QFont()
119 | font.setFamily("华文楷体")
120 | font.setPointSize(12)
121 | font.setBold(False)
122 | font.setItalic(False)
123 | font.setWeight(9)
124 | self.textBrowser_2.setFont(font)
125 | self.textBrowser_2.setStyleSheet("color: rgb(255, 0, 0);\n")
126 | self.textBrowser_2.setObjectName("textBrowser_2")
127 | self.textBrowser_2.setStyleSheet("QTextBrowser{border-width:0;border-style:outset}")
128 |
129 |
130 |
131 | self.retranslateUi(MainWindow)
132 | QtCore.QMetaObject.connectSlotsByName(MainWindow)
133 |
134 | #设置信号槽
135 | self.liButton.clicked.connect(self.back_out)
136 |
137 | def back_out(self):
138 | rootname = self.text
139 | nickname = self.W[0]
140 | pwd = self.pwText.text()
141 | gender = self.L[0]
142 | tel = self.W[3]
143 | address = self.W[5]
144 | email = self.W[4]
145 | birthday = self.W[2]
146 | avatar = self.T[0]
147 | style = self.W[1]
148 | onlinestatus = "离线"
149 |
150 |
151 |
152 | info_dict = {
153 | "rootname":rootname,
154 | "nickname":nickname,
155 | "pwd":pwd,
156 | "gender":gender,
157 | "tel":tel,
158 | "address":address,
159 | "email":email,
160 | "birthday":birthday,
161 | "avatar":avatar,
162 | "style":style,
163 | "onlinestatus":onlinestatus
164 | }
165 |
166 | self.s.send("Z".encode())
167 | time.sleep(0.5)
168 | self.s.send(json.dumps(info_dict).encode())
169 | self.textBrowser_2.clear()
170 |
171 | pa = ""
172 | if self.pwText_2.text() == self.pwText.text():
173 | pa += "设置成功,请返回登录"
174 | self.textBrowser_2.append(pa)
175 | print(self.pwText.text())
176 | time.sleep(1)
177 | self.hide()
178 |
179 | else:
180 | pa += "两次密码不一致,请重新输入"
181 | self.textBrowser_2.append(pa)
182 | self.pwText.clear()
183 | self.pwText_2.clear()
184 |
185 |
186 |
187 | def zhanghao(self, text):
188 | self.textBrowser.append(text)
189 |
190 |
191 | def retranslateUi(self, MainWindow):
192 | _translate = QtCore.QCoreApplication.translate
193 | MainWindow.setFixedSize(MainWindow.width(), MainWindow.height())
194 | MainWindow.setWindowTitle(_translate("MainWindow", "注册中"))
195 | MainWindow.setWindowIcon(QtGui.QIcon("icon.png"))
196 | self.label.setText(_translate("MainWindow", "您好!"))
197 | self.label_2.setText(_translate("MainWindow", "账号:"))
198 | self.label_3.setText(_translate("MainWindow", "恭喜您注册成功。请对你的账号做相应的设置!"))
199 | self.label_5.setText(_translate("MainWindow", "密码:"))
200 | self.label_6.setText(_translate("MainWindow", "确认密码:"))
201 | self.liButton.setText(_translate("MainWindow", "设置完成"))
202 |
--------------------------------------------------------------------------------
/module/zhuce.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/module/zhuce.txt
--------------------------------------------------------------------------------
/sound/bullet.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/sound/bullet.wav
--------------------------------------------------------------------------------
/sound/button.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/sound/button.wav
--------------------------------------------------------------------------------
/sound/enemy1_down.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/sound/enemy1_down.wav
--------------------------------------------------------------------------------
/sound/enemy2_down.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/sound/enemy2_down.wav
--------------------------------------------------------------------------------
/sound/enemy3_down.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/sound/enemy3_down.wav
--------------------------------------------------------------------------------
/sound/enemy3_flying.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/sound/enemy3_flying.wav
--------------------------------------------------------------------------------
/sound/game_music.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/sound/game_music.ogg
--------------------------------------------------------------------------------
/sound/get_bomb.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/sound/get_bomb.wav
--------------------------------------------------------------------------------
/sound/get_bullet.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/sound/get_bullet.wav
--------------------------------------------------------------------------------
/sound/me_down.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/sound/me_down.wav
--------------------------------------------------------------------------------
/sound/supply.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/sound/supply.wav
--------------------------------------------------------------------------------
/sound/upgrade.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/sound/upgrade.wav
--------------------------------------------------------------------------------
/sound/use_bomb.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/sound/use_bomb.wav
--------------------------------------------------------------------------------
/start_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/start_back.png
--------------------------------------------------------------------------------
/tftp_server.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 | from socket import *
4 | import multiprocessing as mp
5 | import os
6 | import signal
7 | import sys
8 | import time
9 |
10 | # 文件库
11 | FILE_PATH = "C:/Users/admin/Desktop/"
12 |
13 | # 服务器功能
14 |
15 |
16 | class TftpServer(object):
17 |
18 | def __init__(self, connfd):
19 | self.connfd = connfd
20 |
21 | def handler(self):
22 | while True:
23 | data = self.connfd.recv(1024).decode()
24 | if not data or data[0] == 'Q':
25 | print(self.connfd.getpeername, "客户端退出")
26 | self.connfd.close()
27 | sys.exit(0)
28 | elif data[0] == "L":
29 | self.do_list()
30 | elif data[0] == "G":
31 | filename = data[2:]
32 | self.do_get(filename)
33 | elif data[0] == "P":
34 | filename = data[2:]
35 | self.do_put(filename)
36 |
37 | def do_list(self):
38 | # 获取列表
39 | file_list = os.listdir(FILE_PATH)
40 | if not file_list:
41 | self.connfd.send("文件库为空".encode())
42 | return
43 | else:
44 | self.connfd.send(b'OK')
45 | time.sleep(0.1)
46 | files = ""
47 | for file in file_list:
48 | if file[0] != '.' and \
49 | os.path.isfile(FILE_PATH + file):
50 | files = files + file + '#'
51 | # 发送给客户端
52 | self.connfd.send(files.encode())
53 |
54 | def do_get(self, filename):
55 | try:
56 | fd = open(FILE_PATH + filename, 'rb')
57 | except:
58 | self.connfd.send("文件不存在".encode())
59 | return
60 | self.connfd.send(b'OK')
61 | time.sleep(0.1)
62 |
63 | # 发送文件
64 | while True:
65 | data = fd.read(1024)
66 | if not data:
67 | time.sleep(0.1)
68 | self.connfd.send(b'##')
69 | break
70 | self.connfd.send(data)
71 |
72 | print("文件发送完成")
73 |
74 | def do_put(self, filename):
75 | try:
76 | fd = open(FILE_PATH + filename, 'wb')
77 | except:
78 | self.connfd.send("无法上传".encode())
79 | return
80 | self.connfd.send(b'OK')
81 |
82 | while True:
83 | data = self.connfd.recv(1024)
84 | if data == b"##":
85 | break
86 | fd.write(data)
87 | fd.close()
88 | print("上传完毕")
89 |
90 | # 控制程序流程 创建套接字,接收链接,创建子进程
91 |
92 |
93 | def main():
94 | HOST = "0.0.0.0"
95 | PORT = 8888
96 | ADDR = (HOST, PORT)
97 |
98 | s = socket()
99 | s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
100 | s.bind(ADDR)
101 | s.listen(5)
102 |
103 | print("Listen to port 8888....")
104 | # signal.signal(signal.SIGCHLD,signal.SIG_IGN)
105 |
106 | while True:
107 | try:
108 | connfd, addr = s.accept()
109 | except KeyboardInterrupt:
110 | s.close()
111 | sys.exit("退出服务器")
112 | except Exception as e:
113 | print(e)
114 | continue
115 | print("客户端登录:", addr)
116 | tftp = TftpServer(connfd)
117 | p = mp.Process(target=tftp.handler)
118 | p.start()
119 | time.sleep(0.1)
120 | p.join()
121 |
122 | if __name__ == "__main__":
123 | main()
124 |
--------------------------------------------------------------------------------
/upload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/upload.png
--------------------------------------------------------------------------------
/view/Chat - 副本.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # Form implementation generated from reading ui file 'Chat.ui'
4 | #
5 | # Created by: PyQt5 UI code generator 5.11.2
6 | #
7 | # WARNING! All changes made in this file will be lost!
8 |
9 | from PyQt5 import QtCore, QtGui, QtWidgets
10 | from module.items import *
11 |
12 | class Ui_ChatForm(object):
13 | def setupUi(self, ChatForm):
14 | ChatForm.setObjectName("ChatForm")
15 | ChatForm.resize(1590, 900)
16 | self.send_Button = QtWidgets.QPushButton(ChatForm)
17 | self.send_Button.setGeometry(QtCore.QRect(1010, 840, 75, 41))
18 | self.send_Button.setText("")
19 | self.send_Button.setObjectName("send_Button")
20 | self.textBrowser = QtWidgets.QTextBrowser(ChatForm)
21 | self.textBrowser.setGeometry(QtCore.QRect(430, 90, 681, 631))
22 | self.textBrowser.setObjectName("textBrowser")
23 | self.textEdit = QtWidgets.QTextEdit(ChatForm)
24 | self.textEdit.setGeometry(QtCore.QRect(430, 740, 681, 101))
25 | self.textEdit.setObjectName("textEdit")
26 | self.pushButton1 = QtWidgets.QPushButton(ChatForm)
27 | self.pushButton1.setGeometry(QtCore.QRect(150, 210, 75, 23))
28 | self.pushButton1.setObjectName("pushButton1")
29 | self.pushButton1_2 = QtWidgets.QPushButton(ChatForm)
30 | self.pushButton1_2.setGeometry(QtCore.QRect(150, 170, 75, 23))
31 | self.pushButton1_2.setObjectName("pushButton1_2")
32 | self.f_avatar_label = QtWidgets.QLabel(ChatForm)
33 | self.f_avatar_label.setGeometry(QtCore.QRect(1170, 40, 171, 171))
34 | self.f_avatar_label.setStyleSheet("")
35 | self.f_avatar_label.setText("")
36 | self.f_avatar_label.setScaledContents(True)
37 | self.f_avatar_label.setObjectName("f_avatar_label")
38 | self.f_nickname_label = QtWidgets.QLabel(ChatForm)
39 | self.f_nickname_label.setGeometry(QtCore.QRect(1170, 220, 181, 41))
40 | self.f_nickname_label.setText("")
41 | self.f_nickname_label.setObjectName("f_nickname_label")
42 | self.chatname_label = QtWidgets.QLabel(ChatForm)
43 | self.chatname_label.setGeometry(QtCore.QRect(450, 20, 191, 41))
44 | self.chatname_label.setText("")
45 | self.chatname_label.setObjectName("chatname_label")
46 | self.verticalLayoutWidget = QtWidgets.QWidget(ChatForm)
47 | self.verticalLayoutWidget.setGeometry(QtCore.QRect(1200, 350, 160, 181))
48 | self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
49 | self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
50 | self.verticalLayout.setContentsMargins(0, 0, 0, 0)
51 | self.verticalLayout.setObjectName("verticalLayout")
52 | self.address_label = QtWidgets.QLabel(self.verticalLayoutWidget)
53 | self.address_label.setText("")
54 | self.address_label.setObjectName("address_label")
55 | self.verticalLayout.addWidget(self.address_label)
56 | self.email_label = QtWidgets.QLabel(self.verticalLayoutWidget)
57 | self.email_label.setText("")
58 | self.email_label.setObjectName("email_label")
59 | self.verticalLayout.addWidget(self.email_label)
60 | self.tel_label = QtWidgets.QLabel(self.verticalLayoutWidget)
61 | self.tel_label.setText("")
62 | self.tel_label.setObjectName("tel_label")
63 | self.verticalLayout.addWidget(self.tel_label)
64 | self.birthday_label = QtWidgets.QLabel(self.verticalLayoutWidget)
65 | self.birthday_label.setText("")
66 | self.birthday_label.setObjectName("birthday_label")
67 | self.verticalLayout.addWidget(self.birthday_label)
68 | self.pushButton1_3 = QtWidgets.QPushButton(ChatForm)
69 | self.pushButton1_3.setGeometry(QtCore.QRect(150, 250, 75, 23))
70 | self.pushButton1_3.setObjectName("pushButton1_3")
71 | self.onlinestatus_label = QtWidgets.QLabel(ChatForm)
72 | self.onlinestatus_label.setGeometry(QtCore.QRect(660, 30, 54, 21))
73 | self.onlinestatus_label.setText("")
74 | self.onlinestatus_label.setObjectName("onlinestatus_label")
75 | self.style_label = QtWidgets.QLabel(ChatForm)
76 | self.style_label.setGeometry(QtCore.QRect(1160, 290, 211, 41))
77 | self.style_label.setText("")
78 | self.style_label.setObjectName("style_label")
79 | self.my_avatar_label = QtWidgets.QLabel(ChatForm)
80 | self.my_avatar_label.setGeometry(QtCore.QRect(20, 10, 61, 61))
81 | self.my_avatar_label.setText("")
82 | self.my_avatar_label.setScaledContents(True)
83 | self.my_avatar_label.setObjectName("my_avatar_label")
84 | self.quit_Button = QtWidgets.QPushButton(ChatForm)
85 | self.quit_Button.setGeometry(QtCore.QRect(10, 820, 70, 70))
86 | self.quit_Button.setText("")
87 | self.quit_Button.setObjectName("quit_Button")
88 | self.pushButton1_4 = QtWidgets.QPushButton(ChatForm)
89 | self.pushButton1_4.setGeometry(QtCore.QRect(150, 120, 75, 23))
90 | self.pushButton1_4.setObjectName("pushButton1_4")
91 | self.listWidget1 = QtWidgets.QListWidget(ChatForm)
92 | self.listWidget1.setGeometry(QtCore.QRect(115, 90, 271, 751))
93 | self.listWidget1.setObjectName("listWidget")
94 | item = QtWidgets.QListWidgetItem()
95 | self.listWidget1.addItem(item)
96 | self.listWidget1_1 = ListWindow(ChatForm)
97 | self.listWidget1_1.setGeometry(QtCore.QRect(100, 80, 320, 800))
98 |
99 | self.retranslateUi(ChatForm)
100 | QtCore.QMetaObject.connectSlotsByName(ChatForm)
101 |
102 | def retranslateUi(self, ChatForm):
103 | _translate = QtCore.QCoreApplication.translate
104 | ChatForm.setWindowTitle(_translate("ChatForm", "Form"))
105 | self.pushButton1.setText(_translate("ChatForm", "10001"))
106 | self.pushButton1_2.setText(_translate("ChatForm", "10000"))
107 | self.pushButton1_3.setText(_translate("ChatForm", "10002"))
108 | self.pushButton1_4.setText(_translate("ChatForm", "小Root"))
109 | __sortingEnabled = self.listWidget1.isSortingEnabled()
110 | self.listWidget1.setSortingEnabled(False)
111 | item = self.listWidget1.item(0)
112 | item.setText(_translate("ChatForm", "New Item"))
113 | self.listWidget1.setSortingEnabled(__sortingEnabled)
114 |
115 |
--------------------------------------------------------------------------------
/view/Chat - 副本.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | ChatForm
4 |
5 |
6 |
7 | 0
8 | 0
9 | 1509
10 | 900
11 |
12 |
13 |
14 | Form
15 |
16 |
17 | background-image:url("images/Chat.jpg")
18 |
19 |
20 |
21 |
22 | 1010
23 | 840
24 | 75
25 | 41
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | 430
36 | 90
37 | 681
38 | 631
39 |
40 |
41 |
42 |
43 |
44 |
45 | 430
46 | 740
47 | 681
48 | 101
49 |
50 |
51 |
52 |
53 |
54 |
55 | 150
56 | 210
57 | 75
58 | 23
59 |
60 |
61 |
62 | 10001
63 |
64 |
65 |
66 |
67 |
68 | 150
69 | 170
70 | 75
71 | 23
72 |
73 |
74 |
75 | 10000
76 |
77 |
78 |
79 |
80 |
81 | 1170
82 | 40
83 | 171
84 | 171
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 | true
95 |
96 |
97 |
98 |
99 |
100 | 1170
101 | 220
102 | 181
103 | 41
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 | 450
114 | 20
115 | 191
116 | 41
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 | 1200
127 | 350
128 | 160
129 | 181
130 |
131 |
132 |
133 | -
134 |
135 |
136 |
137 |
138 |
139 |
140 | -
141 |
142 |
143 |
144 |
145 |
146 |
147 | -
148 |
149 |
150 |
151 |
152 |
153 |
154 | -
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 | 150
167 | 250
168 | 75
169 | 23
170 |
171 |
172 |
173 | 10002
174 |
175 |
176 |
177 |
178 |
179 | 660
180 | 30
181 | 54
182 | 21
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 | 1160
193 | 290
194 | 211
195 | 41
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 | 20
206 | 10
207 | 61
208 | 61
209 |
210 |
211 |
212 |
213 |
214 |
215 | true
216 |
217 |
218 |
219 |
220 |
221 | 10
222 | 820
223 | 70
224 | 70
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 | 150
235 | 120
236 | 75
237 | 23
238 |
239 |
240 |
241 | 小Root
242 |
243 |
244 |
245 |
246 |
247 | 115
248 | 90
249 | 271
250 | 751
251 |
252 |
253 | -
254 |
255 | New Item
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
--------------------------------------------------------------------------------
/view/Chat.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # Form implementation generated from reading ui file 'Chat.ui'
4 | #
5 | # Created by: PyQt5 UI code generator 5.11.2
6 | #
7 | # WARNING! All changes made in this file will be lost!
8 |
9 | from PyQt5 import QtCore, QtGui, QtWidgets
10 | from module.items import *
11 |
12 | class Ui_ChatForm(object):
13 | def setupUi(self, ChatForm):
14 | ChatForm.setObjectName("ChatForm")
15 | ChatForm.resize(1400, 900)
16 | ChatForm.setStyleSheet("")
17 | self.send_Button = QtWidgets.QPushButton(ChatForm)
18 | self.send_Button.setGeometry(QtCore.QRect(1010, 840, 75, 41))
19 | self.send_Button.setText("")
20 | self.send_Button.setObjectName("send_Button")
21 | self.textBrowser = QtWidgets.QTextBrowser(ChatForm)
22 | self.textBrowser.setGeometry(QtCore.QRect(430, 90, 681, 631))
23 | self.textBrowser.setObjectName("textBrowser")
24 | self.textEdit = QtWidgets.QTextEdit(ChatForm)
25 | self.textEdit.setGeometry(QtCore.QRect(430, 740, 681, 101))
26 | self.textEdit.setObjectName("textEdit")
27 | self.pushButton1 = QtWidgets.QPushButton(ChatForm)
28 | self.pushButton1.setGeometry(QtCore.QRect(150, 210, 75, 23))
29 | self.pushButton1.setObjectName("pushButton1")
30 | self.pushButton1_2 = QtWidgets.QPushButton(ChatForm)
31 | self.pushButton1_2.setGeometry(QtCore.QRect(150, 170, 75, 23))
32 | self.pushButton1_2.setObjectName("pushButton1_2")
33 | self.f_avatar_label = QtWidgets.QLabel(ChatForm)
34 | self.f_avatar_label.setGeometry(QtCore.QRect(1170, 40, 171, 171))
35 | self.f_avatar_label.setStyleSheet("")
36 | self.f_avatar_label.setText("")
37 | self.f_avatar_label.setScaledContents(True)
38 | self.f_avatar_label.setObjectName("f_avatar_label")
39 | self.f_nickname_label = QtWidgets.QLabel(ChatForm)
40 | self.f_nickname_label.setGeometry(QtCore.QRect(1170, 220, 181, 41))
41 | self.f_nickname_label.setText("")
42 | self.f_nickname_label.setObjectName("f_nickname_label")
43 | self.chatname_label = QtWidgets.QLabel(ChatForm)
44 | self.chatname_label.setGeometry(QtCore.QRect(450, 20, 191, 41))
45 | self.chatname_label.setText("")
46 | self.chatname_label.setObjectName("chatname_label")
47 | self.verticalLayoutWidget = QtWidgets.QWidget(ChatForm)
48 | self.verticalLayoutWidget.setGeometry(QtCore.QRect(1200, 350, 160, 181))
49 | self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
50 | self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
51 | self.verticalLayout.setContentsMargins(0, 0, 0, 0)
52 | self.verticalLayout.setObjectName("verticalLayout")
53 | self.address_label = QtWidgets.QLabel(self.verticalLayoutWidget)
54 | self.address_label.setText("")
55 | self.address_label.setObjectName("address_label")
56 | self.verticalLayout.addWidget(self.address_label)
57 | self.email_label = QtWidgets.QLabel(self.verticalLayoutWidget)
58 | self.email_label.setText("")
59 | self.email_label.setObjectName("email_label")
60 | self.verticalLayout.addWidget(self.email_label)
61 | self.tel_label = QtWidgets.QLabel(self.verticalLayoutWidget)
62 | self.tel_label.setText("")
63 | self.tel_label.setObjectName("tel_label")
64 | self.verticalLayout.addWidget(self.tel_label)
65 | self.birthday_label = QtWidgets.QLabel(self.verticalLayoutWidget)
66 | self.birthday_label.setText("")
67 | self.birthday_label.setObjectName("birthday_label")
68 | self.verticalLayout.addWidget(self.birthday_label)
69 | self.pushButton1_3 = QtWidgets.QPushButton(ChatForm)
70 | self.pushButton1_3.setGeometry(QtCore.QRect(150, 250, 75, 23))
71 | self.pushButton1_3.setObjectName("pushButton1_3")
72 | self.onlinestatus_label = QtWidgets.QLabel(ChatForm)
73 | self.onlinestatus_label.setGeometry(QtCore.QRect(660, 30, 54, 21))
74 | self.onlinestatus_label.setText("")
75 | self.onlinestatus_label.setObjectName("onlinestatus_label")
76 | self.style_label = QtWidgets.QLabel(ChatForm)
77 | self.style_label.setGeometry(QtCore.QRect(1160, 290, 211, 41))
78 | self.style_label.setText("")
79 | self.style_label.setObjectName("style_label")
80 | self.my_avatar_label = QtWidgets.QLabel(ChatForm)
81 | self.my_avatar_label.setGeometry(QtCore.QRect(20, 10, 61, 61))
82 | self.my_avatar_label.setText("")
83 | self.my_avatar_label.setScaledContents(True)
84 | self.my_avatar_label.setObjectName("my_avatar_label")
85 | self.quit_Button = QtWidgets.QPushButton(ChatForm)
86 | self.quit_Button.setGeometry(QtCore.QRect(10, 820, 70, 70))
87 | self.quit_Button.setText("")
88 | self.quit_Button.setObjectName("quit_Button")
89 | self.pushButton1_4 = QtWidgets.QPushButton(ChatForm)
90 | self.pushButton1_4.setGeometry(QtCore.QRect(150, 120, 75, 23))
91 | self.pushButton1_4.setObjectName("pushButton1_4")
92 | self.listWidget = QtWidgets.QListWidget(ChatForm)
93 | self.listWidget.setGeometry(QtCore.QRect(115, 90, 271, 751))
94 | self.listWidget.setObjectName("listWidget")
95 | item = QtWidgets.QListWidgetItem()
96 | self.listWidget.addItem(item)
97 | self.pushButton = QtWidgets.QPushButton(ChatForm)
98 | self.pushButton.setGeometry(QtCore.QRect(0, 160, 99, 81))
99 | self.pushButton.setText("")
100 | self.pushButton.setObjectName("pushButton")
101 | self.listWidget1 = QtWidgets.QListWidget(ChatForm)
102 | self.listWidget1.setGeometry(QtCore.QRect(115, 90, 271, 751))
103 | self.listWidget1.setObjectName("listWidget")
104 | item = QtWidgets.QListWidgetItem()
105 | self.listWidget1.addItem(item)
106 | self.listWidget1_1 = ListWindow(ChatForm)
107 | self.listWidget1_1.setGeometry(QtCore.QRect(100, 80, 320, 800))
108 | self.pushButton_2 = QtWidgets.QPushButton(ChatForm)
109 | self.pushButton_2.setGeometry(QtCore.QRect(0, 240, 99, 81))
110 | self.pushButton_2.setText("")
111 | self.pushButton_2.setObjectName("pushButton_2")
112 | self.pushButton_3 = QtWidgets.QPushButton(ChatForm)
113 | self.pushButton_3.setGeometry(QtCore.QRect(0, 320, 99, 81))
114 | self.pushButton_3.setText("")
115 | self.pushButton_3.setObjectName("pushButton_3")
116 | self.pushButton_4 = QtWidgets.QPushButton(ChatForm)
117 | self.pushButton_4.setGeometry(QtCore.QRect(0, 400, 99, 81))
118 | self.pushButton_4.setText("")
119 | self.pushButton_4.setObjectName("pushButton_4")
120 | self.pushButton_6 = QtWidgets.QPushButton(ChatForm)
121 | self.pushButton_6.setGeometry(QtCore.QRect(920, 18, 65, 48))
122 | self.pushButton_6.setText("")
123 | self.pushButton_6.setObjectName("pushButton_6")
124 |
125 | self.pushButton_7 = QtWidgets.QPushButton(ChatForm)
126 | self.pushButton_7.setGeometry(QtCore.QRect(0, 90, 99, 70))
127 | self.pushButton_7.setText("")
128 | self.pushButton_7.setObjectName("pushButton_7")
129 |
130 | self.retranslateUi(ChatForm)
131 | QtCore.QMetaObject.connectSlotsByName(ChatForm)
132 |
133 | def retranslateUi(self, ChatForm):
134 | _translate = QtCore.QCoreApplication.translate
135 | ChatForm.setWindowTitle(_translate("ChatForm", "Root"))
136 | ChatForm.setFixedSize(ChatForm.width(), ChatForm.height())
137 | self.pushButton1.setText(_translate("ChatForm", "10001"))
138 | self.pushButton1_2.setText(_translate("ChatForm", "10000"))
139 | self.pushButton1_3.setText(_translate("ChatForm", "10002"))
140 | self.pushButton1_4.setText(_translate("ChatForm", "小Root"))
141 | __sortingEnabled = self.listWidget.isSortingEnabled()
142 | self.listWidget.setSortingEnabled(False)
143 | item = self.listWidget.item(0)
144 | item.setText(_translate("ChatForm", "New Item"))
145 | self.listWidget.setSortingEnabled(__sortingEnabled)
--------------------------------------------------------------------------------
/view/Chat.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | ChatForm
4 |
5 |
6 |
7 | 0
8 | 0
9 | 1509
10 | 900
11 |
12 |
13 |
14 | Form
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | 1010
23 | 840
24 | 75
25 | 41
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | 430
36 | 90
37 | 681
38 | 631
39 |
40 |
41 |
42 |
43 |
44 |
45 | 430
46 | 740
47 | 681
48 | 101
49 |
50 |
51 |
52 |
53 |
54 |
55 | 150
56 | 210
57 | 75
58 | 23
59 |
60 |
61 |
62 | 10001
63 |
64 |
65 |
66 |
67 |
68 | 150
69 | 170
70 | 75
71 | 23
72 |
73 |
74 |
75 | 10000
76 |
77 |
78 |
79 |
80 |
81 | 1170
82 | 40
83 | 171
84 | 171
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 | true
95 |
96 |
97 |
98 |
99 |
100 | 1170
101 | 220
102 | 181
103 | 41
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 | 450
114 | 20
115 | 191
116 | 41
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 | 1200
127 | 350
128 | 160
129 | 181
130 |
131 |
132 |
133 | -
134 |
135 |
136 |
137 |
138 |
139 |
140 | -
141 |
142 |
143 |
144 |
145 |
146 |
147 | -
148 |
149 |
150 |
151 |
152 |
153 |
154 | -
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 | 150
167 | 250
168 | 75
169 | 23
170 |
171 |
172 |
173 | 10002
174 |
175 |
176 |
177 |
178 |
179 | 660
180 | 30
181 | 54
182 | 21
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 | 1160
193 | 290
194 | 211
195 | 41
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 | 20
206 | 10
207 | 61
208 | 61
209 |
210 |
211 |
212 |
213 |
214 |
215 | true
216 |
217 |
218 |
219 |
220 |
221 | 10
222 | 820
223 | 70
224 | 70
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 | 150
235 | 120
236 | 75
237 | 23
238 |
239 |
240 |
241 | 小Root
242 |
243 |
244 |
245 |
246 |
247 | 115
248 | 90
249 | 271
250 | 751
251 |
252 |
253 | -
254 |
255 | New Item
256 |
257 |
258 |
259 |
260 |
261 |
262 | 0
263 | 160
264 | 99
265 | 81
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 | 0
276 | 240
277 | 99
278 | 81
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 | 0
289 | 320
290 | 99
291 | 81
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 | 0
302 | 400
303 | 99
304 | 81
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 | 0
315 | 480
316 | 99
317 | 81
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 | 920
328 | 10
329 | 65
330 | 48
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
--------------------------------------------------------------------------------
/view/Login.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # Form implementation generated from reading ui file 'Login.ui'
4 | #
5 | # Created by: PyQt5 UI code generator 5.11.2
6 | #
7 | # WARNING! All changes made in this file will be lost!
8 |
9 | from PyQt5 import QtCore, QtGui, QtWidgets
10 |
11 | class Ui_ChatLoginWindow(object):
12 | def setupUi(self, ChatLoginWindow):
13 | ChatLoginWindow.setObjectName("ChatLoginWindow")
14 | ChatLoginWindow.resize(477, 650)
15 | ChatLoginWindow.setStyleSheet("background-image:url(\"../images/bg.jpg\")")
16 | self.centralwidget = QtWidgets.QWidget(ChatLoginWindow)
17 | self.centralwidget.setObjectName("centralwidget")
18 | self.txt_user = QtWidgets.QLineEdit(self.centralwidget)
19 | self.txt_user.setGeometry(QtCore.QRect(120, 300, 261, 51))
20 | self.txt_user.setInputMethodHints(QtCore.Qt.ImhHiddenText)
21 | self.txt_user.setObjectName("txt_user")
22 | self.txt_pwd = QtWidgets.QLineEdit(self.centralwidget)
23 | self.txt_pwd.setGeometry(QtCore.QRect(120, 390, 261, 51))
24 | self.txt_pwd.setInputMethodHints(QtCore.Qt.ImhHiddenText)
25 | self.txt_pwd.setObjectName("txt_pwd")
26 | self.horizontalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
27 | self.horizontalLayoutWidget.setGeometry(QtCore.QRect(100, 470, 281, 31))
28 | self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
29 | self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
30 | self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
31 | self.horizontalLayout.setObjectName("horizontalLayout")
32 | self.chk_remenber = QtWidgets.QCheckBox(self.horizontalLayoutWidget)
33 | self.chk_remenber.setObjectName("chk_remenber")
34 | self.horizontalLayout.addWidget(self.chk_remenber)
35 | self.chk_forget = QtWidgets.QCheckBox(self.horizontalLayoutWidget)
36 | self.chk_forget.setObjectName("chk_forget")
37 | self.horizontalLayout.addWidget(self.chk_forget)
38 | self.chk_register = QtWidgets.QCheckBox(self.horizontalLayoutWidget)
39 | self.chk_register.setObjectName("chk_register")
40 | self.horizontalLayout.addWidget(self.chk_register)
41 | self.btn_login = QtWidgets.QPushButton(self.centralwidget)
42 | self.btn_login.setGeometry(QtCore.QRect(90, 520, 301, 41))
43 | self.btn_login.setObjectName("btn_login")
44 | ChatLoginWindow.setCentralWidget(self.centralwidget)
45 | self.menubar = QtWidgets.QMenuBar(ChatLoginWindow)
46 | self.menubar.setGeometry(QtCore.QRect(0, 0, 477, 23))
47 | self.menubar.setObjectName("menubar")
48 | ChatLoginWindow.setMenuBar(self.menubar)
49 | self.statusbar = QtWidgets.QStatusBar(ChatLoginWindow)
50 | self.statusbar.setObjectName("statusbar")
51 | ChatLoginWindow.setStatusBar(self.statusbar)
52 |
53 | self.retranslateUi(ChatLoginWindow)
54 | QtCore.QMetaObject.connectSlotsByName(ChatLoginWindow)
55 |
56 | def retranslateUi(self, ChatLoginWindow):
57 | _translate = QtCore.QCoreApplication.translate
58 | ChatLoginWindow.setWindowTitle(_translate("ChatLoginWindow", "MainWindow"))
59 | ChatLoginWindow.setFixedSize(ChatLoginWindow.width(), ChatLoginWindow.height())
60 | self.chk_remenber.setText(_translate("ChatLoginWindow", "记住密码"))
61 | self.chk_forget.setText(_translate("ChatLoginWindow", "忘记密码"))
62 | self.chk_register.setText(_translate("ChatLoginWindow", "注册账号"))
63 | self.btn_login.setText(_translate("ChatLoginWindow", "登录"))
64 |
65 |
--------------------------------------------------------------------------------
/view/Login.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | ChatLoginWindow
4 |
5 |
6 |
7 | 0
8 | 0
9 | 477
10 | 680
11 |
12 |
13 |
14 | MainWindow
15 |
16 |
17 | background-image:url("../images/bg.jpg")
18 |
19 |
20 |
21 |
22 |
23 | 120
24 | 300
25 | 261
26 | 51
27 |
28 |
29 |
30 | Qt::ImhHiddenText
31 |
32 |
33 |
34 |
35 |
36 | 120
37 | 390
38 | 261
39 | 51
40 |
41 |
42 |
43 | Qt::ImhHiddenText
44 |
45 |
46 |
47 |
48 |
49 | 100
50 | 470
51 | 281
52 | 31
53 |
54 |
55 |
56 | -
57 |
58 |
59 | 记住密码
60 |
61 |
62 |
63 | -
64 |
65 |
66 | 忘记密码
67 |
68 |
69 |
70 | -
71 |
72 |
73 | 注册账号
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 | 90
83 | 520
84 | 301
85 | 41
86 |
87 |
88 |
89 | 登录
90 |
91 |
92 |
93 |
103 |
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/view/__pycache__/Chat.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/view/__pycache__/Chat.cpython-36.pyc
--------------------------------------------------------------------------------
/view/__pycache__/Login.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/view/__pycache__/Login.cpython-36.pyc
--------------------------------------------------------------------------------
/view/pushbutton.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | MainWindow
4 |
5 |
6 |
7 | 0
8 | 0
9 | 800
10 | 600
11 |
12 |
13 |
14 | MainWindow
15 |
16 |
17 |
18 |
19 |
20 | 340
21 | 200
22 | 75
23 | 23
24 |
25 |
26 |
27 | PushButton
28 |
29 |
30 |
31 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/view/qss/Chat_style.qss:
--------------------------------------------------------------------------------
1 | QWidget#ChatForm{
2 | background: url("images/Chat.jpg") no-repeat
3 |
4 | }
5 | QLabel#f_avatar_label{
6 | border-radius: 50%;
7 | }
8 | QLabel#my_avatar_label{
9 | border-radius: 50%;
10 | }
11 | QLabel#f_avatar_label:hover,QLabel#my_avatar_label:hover{
12 | border: 2px solid #fff;
13 | }
14 | QLabel#f_nickname_label{
15 | font-size: 24px;
16 | font-weight: bold;
17 | color: #818990;
18 | }
19 | QLabel#address_label,QLabel#birthday_label,QLabel#email_label,QLabel#tel_label{
20 | font-size: 16px;
21 | font-weight: bold;
22 | color: #D7DCE2;
23 | }
24 | QLabel#style_label{
25 | font-size:16px;
26 | color: #818990;
27 | }
28 | QLabel#chatname_label{
29 | font-size: 24px;
30 | font-weight: bold;
31 | color: #AAE0DB;
32 | }
33 | QLabel#onlinestatus_label{
34 | font-size: 16px;
35 | font-weight: bold;
36 | color: #818990;
37 | }
38 | QTextBrowser#textBrowser{
39 | border: none;
40 | font-size: 20px;
41 | color: #58C9FF;
42 | }
43 | QTextEdit#textEdit{
44 | border: none;
45 | font-size: 16px;
46 | }
47 |
48 | QPushButton#send_Button{
49 | background: url("images/btn_send.png") transparent no-repeat;
50 | }
51 | QPushButton#send_Button:hover{
52 | background: url("images/btn_sendhover.png") transparent no-repeat;
53 | }
54 | QPushButton#quit_Button{
55 | background: url("images/btn_quit.png") transparent no-repeat;
56 | }
57 | QPushButton#quit_Button:hover{
58 | background: url("images/btn_quithover.png") transparent no-repeat;
59 | }
60 |
61 | QPushButton#first_pushButton{
62 | background: url("images/test1.png") transparent no-repeat;
63 | }
64 | QPushButton#first_pushButton:hover{
65 | background: url("images/icon.png") transparent no-repeat;
66 | }
67 |
68 | QPushButton#pushButton{
69 | background: transparent;
70 | }
71 | QPushButton#pushButton:hover{
72 | background: url("images/add.png") transparent no-repeat;
73 | }
74 |
75 | QPushButton#pushButton_2{
76 | background: transparent;
77 | }
78 | QPushButton#pushButton_2:hover{
79 | background: url("images/upfile.png") transparent no-repeat;
80 | }
81 | QPushButton#pushButton_3{
82 | background: transparent;
83 | }
84 | QPushButton#pushButton_3:hover{
85 | background: url("images/game.png") transparent no-repeat;
86 | }
87 |
88 | QPushButton#pushButton_4{
89 | background: transparent;
90 | }
91 | QPushButton#pushButton_4:hover{
92 | background: url("images/info.png") transparent no-repeat;
93 | }
94 |
95 | QPushButton#pushButton_6{
96 | background: transparent;
97 | }
98 | QPushButton#pushButton_6:hover{
99 | background: url("images/file.png") transparent no-repeat;
100 | }
101 |
102 | QPushButton#pushButton_7{
103 | background: transparent;
104 | }
105 | QPushButton#pushButton_7:hover{
106 | background: url("images/shuaxin.png") transparent no-repeat;
107 | }
--------------------------------------------------------------------------------
/view/qss/Login_style.qss:
--------------------------------------------------------------------------------
1 | #ChatLoginWindow{
2 | background: url("images/bg.jpg") no-repeat
3 |
4 | }
5 |
6 | QLineEdit#txt_user{
7 | background: transparent;
8 | height: 35px;
9 | line-height: 35px;
10 | font-size: 20px;
11 | border: 1px solid transparent;
12 | border-bottom: 1px solid #9f9f9f
13 | }
14 |
15 | QLineEdit#txt_user:hover{
16 | border-bottom: 1px solid #84d3fc
17 | }
18 |
19 | QLineEdit#txt_pwd{
20 | background: transparent;
21 | height: 35px;
22 | line-height: 35px;
23 | font-size: 16px;
24 | border: 1px solid transparent;
25 | border-bottom: 1px solid #9f9f9f
26 | }
27 | QLineEdit#txt_pwd:hover{
28 | border-bottom: 1px solid #84d3fc
29 | }
30 |
31 | QCheckBox{
32 | font-size: 18px;
33 | }
34 | QPushButton#btn_login{
35 | background-color: #64caff;
36 | border-radius: 8px;
37 | border:1px solid transparent;
38 | font-size: 18px;
39 | font-weight: bold;
40 | color: #fff
41 | }
42 |
43 | QPushButton#btn_login:hover{
44 | background-color: #84d3fc
45 | }
46 |
--------------------------------------------------------------------------------
/xiangqing.txt:
--------------------------------------------------------------------------------
1 | 123
2 | 456
3 | 789
--------------------------------------------------------------------------------
/yanzhengma.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/yanzhengma.png
--------------------------------------------------------------------------------
/zc/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/zc/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/zc/.idea/zc.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/zc/123.txt:
--------------------------------------------------------------------------------
1 | zhang
2 | 22363
3 |
4 | 4
5 | 5
6 | 465
7 | 4545
8 | 645
9 |
--------------------------------------------------------------------------------
/zc/__pycache__/mysqlRoot.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/__pycache__/mysqlRoot.cpython-36.pyc
--------------------------------------------------------------------------------
/zc/__pycache__/pushbutton2.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/__pycache__/pushbutton2.cpython-36.pyc
--------------------------------------------------------------------------------
/zc/__pycache__/shangchuan.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/__pycache__/shangchuan.cpython-36.pyc
--------------------------------------------------------------------------------
/zc/avatar0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/avatar0.jpg
--------------------------------------------------------------------------------
/zc/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/background.png
--------------------------------------------------------------------------------
/zc/bomb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/bomb.png
--------------------------------------------------------------------------------
/zc/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/icon.png
--------------------------------------------------------------------------------
/zc/icon1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/icon1.png
--------------------------------------------------------------------------------
/zc/icon2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/icon2.png
--------------------------------------------------------------------------------
/zc/mysqlRoot.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | from __future__ import unicode_literals
4 | import pymysql
5 |
6 |
7 | def creatConnect():
8 | conn = pymysql.connect(host="localhost", user="root",
9 | password="123456", db="RootDB", port=3306, charset="utf8")
10 | cur = conn.cursor()
11 | return (conn, cur)
12 |
13 |
14 | def close(conn, cur):
15 | cur.close()
16 | conn.close()
17 |
18 |
19 | def main():
20 | try:
21 | conn, cur = creatConnect()
22 | create_users(conn)
23 | create_friends(conn)
24 | create_history(conn)
25 | conn.commit()
26 | except:
27 | conn = pymysql.connect(host="localhost", user="root",
28 | password="123456", port=3306, charset="utf8")
29 | cur = conn.cursor()
30 | cur.execute('create database RootDB default character set utf8;')
31 | conn.commit()
32 | create_users(conn)
33 | create_friends(conn)
34 | create_history(conn)
35 | conn.commit()
36 | close(conn, cur)
37 |
38 |
39 | def create_users(conn):
40 | s = 'create table users(\
41 | id int auto_increment primary key,\
42 | rootname int,\
43 | nickname varchar(20),\
44 | pwd varchar(32),\
45 | gender enum("男","女","保密"),\
46 | tel varchar(11),\
47 | address varchar(100),\
48 | email varchar(30),\
49 | birthday varchar(15),\
50 | avatar text,\
51 | style varchar(100),\
52 | onlinestatus enum("在线","离线"),\
53 | time timestamp default now(),\
54 | last_online timestamp default now())character set utf8;'
55 | cur = conn.cursor()
56 | try:
57 | cur.execute(s)
58 | conn.commit()
59 | print('users ok')
60 | except:
61 | print("create_users FILL")
62 | conn.rollback()
63 |
64 |
65 | def insert_users(rootname, nickname, pwd, gender, tel, address, email, birthday, avatar, style, onlinestatus):
66 | conn, cur = creatConnect()
67 | s = '''insert into users
68 | (rootname, nickname, pwd, gender, tel, address, email, birthday, avatar, style, onlinestatus)
69 | values("%s","%s","%s","%s","%s","%s","%s","%s","%s","%s","%s")''' % (rootname, nickname, pwd, gender, tel, address, email, birthday, avatar, style, onlinestatus)
70 | try:
71 | cur.execute(s)
72 | conn.commit()
73 | print("insert_users is ok")
74 | except:
75 | print("insert_users FILL")
76 | conn.rollback()
77 | close(conn, cur)
78 |
79 |
80 | def updatestatus_users(rootname, status):
81 | conn, cur = creatConnect()
82 | s = "update users set onlinestatus='%s', last_online=now() where rootname='%s'" % (
83 | status, rootname)
84 | try:
85 | cur.execute(s)
86 | conn.commit()
87 | print("update_users is ok")
88 | except:
89 | print("updatestatus_users FILL")
90 | conn.rollback()
91 | close(conn, cur)
92 |
93 |
94 | def login(rootname, pwd):
95 | conn, cur = creatConnect()
96 | s = "select rootname,nickname,gender,tel,address,email,birthday,avatar,style,onlinestatus,last_online from users where rootname='%s' and pwd='%s'" % (
97 | rootname, pwd)
98 | cur.execute(s)
99 | data = cur.fetchone()
100 | close(conn, cur)
101 | return data
102 |
103 |
104 | def select_users(rootname):
105 | conn, cur = creatConnect()
106 | s = "select rootname,nickname,gender,tel,address,email,birthday,avatar,style,onlinestatus from users where rootname='%s'" % rootname
107 | cur.execute(s)
108 | data = cur.fetchone()
109 | close(conn, cur)
110 | return data
111 |
112 |
113 | def create_friends(conn):
114 | s = '''create table friends(
115 | id int auto_increment primary key,
116 | rootname int not null,
117 | f_rootname int not null)character set utf8;'''
118 | cur = conn.cursor()
119 | try:
120 | cur.execute(s)
121 | conn.commit()
122 | print('create_friends is ok')
123 | except:
124 | print("create_friends FILL")
125 | conn.rollback()
126 |
127 |
128 | def insert_friends(rootname, f_rootname):
129 | conn, cur = creatConnect()
130 | s = 'insert into friends(rootname,f_rootname) values("%s","%s")' % (
131 | rootname, f_rootname)
132 | try:
133 | cur.execute(s)
134 | conn.commit()
135 | print("insert_friends is ok")
136 | except Exception as e:
137 | print(e)
138 | conn.rollback()
139 | close(conn, cur)
140 |
141 |
142 | def select_friends(rootname):
143 | conn, cur = creatConnect()
144 | s = "select users.nickname, friends.f_rootname, users.avatar from friends,users where friends.rootname='%s' and users.rootname=friends.f_rootname;" % rootname
145 | cur.execute(s)
146 | data = cur.fetchall()
147 | close(conn, cur)
148 | return data
149 |
150 |
151 | def create_history(conn):
152 | s = '''create table history(
153 | id int auto_increment primary key,
154 | rootname int not null,
155 | f_rootname int not null,
156 | record text,
157 | time timestamp default now())character set utf8;'''
158 | cur = conn.cursor()
159 | try:
160 | cur.execute(s)
161 | conn.commit()
162 | print('create_history ok')
163 | except:
164 | print("create_history FILL")
165 | conn.rollback()
166 |
167 |
168 | def insert_history(rootname, f_rootname, record):
169 | conn, cur = creatConnect()
170 | print("history:", rootname, f_rootname)
171 | s = "insert into history(rootname, f_rootname, record) values('%s', '%s', '%s')" % (
172 | rootname, f_rootname, record)
173 | try:
174 | cur.execute(s)
175 | conn.commit()
176 | print("insert_hist is ok")
177 | except:
178 | print("insert_history FILL")
179 | conn.rollback()
180 | close(conn, cur)
181 |
182 |
183 | def select_history(rootname, f_rootname):
184 | conn, cur = creatConnect()
185 | s = "select record from history where ((rootname = '%s')and(f_rootname = '%s')) or (( f_rootname = '%s')and(rootname = '%s'))" % (
186 | rootname, f_rootname, f_rootname, rootname)
187 | cur.execute(s)
188 | data = cur.fetchall()
189 | close(conn, cur)
190 | return data
191 |
192 |
193 | def selectfive_history(rootname, f_rootname):
194 | conn, cur = creatConnect()
195 | s = "select record from history where (rootname = '%s' and f_rootname = '%s') or (rootname = '%s' and f_rootname = '%s') order by id desc limit 5;" % (
196 | rootname, f_rootname, f_rootname, rootname)
197 | cur.execute(s)
198 | data = cur.fetchall()
199 | close(conn, cur)
200 | return data
201 |
202 |
203 | def selectlast_online_history(last_online, rootname):
204 | conn, cur = creatConnect()
205 | print("mySQL>", last_online)
206 | s = "select record from history where time > ('%s') and f_rootname = '%s' order by rootname;" % (
207 | last_online, rootname)
208 | cur.execute(s)
209 | data = cur.fetchall()
210 | close(conn, cur)
211 | return data
212 |
213 | main()
214 |
--------------------------------------------------------------------------------
/zc/test-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/test-1.png
--------------------------------------------------------------------------------
/zc/venv/Scripts/Activate.ps1:
--------------------------------------------------------------------------------
1 | function global:deactivate ([switch]$NonDestructive) {
2 | # Revert to original values
3 | if (Test-Path function:_OLD_VIRTUAL_PROMPT) {
4 | copy-item function:_OLD_VIRTUAL_PROMPT function:prompt
5 | remove-item function:_OLD_VIRTUAL_PROMPT
6 | }
7 |
8 | if (Test-Path env:_OLD_VIRTUAL_PYTHONHOME) {
9 | copy-item env:_OLD_VIRTUAL_PYTHONHOME env:PYTHONHOME
10 | remove-item env:_OLD_VIRTUAL_PYTHONHOME
11 | }
12 |
13 | if (Test-Path env:_OLD_VIRTUAL_PATH) {
14 | copy-item env:_OLD_VIRTUAL_PATH env:PATH
15 | remove-item env:_OLD_VIRTUAL_PATH
16 | }
17 |
18 | if (Test-Path env:VIRTUAL_ENV) {
19 | remove-item env:VIRTUAL_ENV
20 | }
21 |
22 | if (!$NonDestructive) {
23 | # Self destruct!
24 | remove-item function:deactivate
25 | }
26 | }
27 |
28 | deactivate -nondestructive
29 |
30 | $env:VIRTUAL_ENV="C:\Users\Administrator\PycharmProjects\zc\venv"
31 |
32 | if (! $env:VIRTUAL_ENV_DISABLE_PROMPT) {
33 | # Set the prompt to include the env name
34 | # Make sure _OLD_VIRTUAL_PROMPT is global
35 | function global:_OLD_VIRTUAL_PROMPT {""}
36 | copy-item function:prompt function:_OLD_VIRTUAL_PROMPT
37 | function global:prompt {
38 | Write-Host -NoNewline -ForegroundColor Green '(venv) '
39 | _OLD_VIRTUAL_PROMPT
40 | }
41 | }
42 |
43 | # Clear PYTHONHOME
44 | if (Test-Path env:PYTHONHOME) {
45 | copy-item env:PYTHONHOME env:_OLD_VIRTUAL_PYTHONHOME
46 | remove-item env:PYTHONHOME
47 | }
48 |
49 | # Add the venv to the PATH
50 | copy-item env:PATH env:_OLD_VIRTUAL_PATH
51 | $env:PATH = "$env:VIRTUAL_ENV\Scripts;$env:PATH"
52 |
--------------------------------------------------------------------------------
/zc/venv/Scripts/_asyncio.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_asyncio.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_asyncio_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_asyncio_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_bz2.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_bz2.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_bz2_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_bz2_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_ctypes.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_ctypes.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_ctypes_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_ctypes_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_ctypes_test.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_ctypes_test.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_ctypes_test_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_ctypes_test_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_decimal.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_decimal.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_decimal_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_decimal_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_elementtree.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_elementtree.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_elementtree_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_elementtree_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_hashlib.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_hashlib.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_hashlib_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_hashlib_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_lzma.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_lzma.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_lzma_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_lzma_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_msi.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_msi.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_msi_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_msi_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_multiprocessing.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_multiprocessing.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_multiprocessing_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_multiprocessing_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_overlapped.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_overlapped.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_overlapped_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_overlapped_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_socket.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_socket.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_socket_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_socket_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_sqlite3.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_sqlite3.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_sqlite3_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_sqlite3_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_ssl.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_ssl.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_ssl_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_ssl_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_testbuffer.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_testbuffer.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_testbuffer_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_testbuffer_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_testcapi.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_testcapi.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_testcapi_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_testcapi_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_testconsole.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_testconsole.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_testconsole_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_testconsole_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_testimportmultiple.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_testimportmultiple.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_testimportmultiple_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_testimportmultiple_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_testmultiphase.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_testmultiphase.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_testmultiphase_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_testmultiphase_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_tkinter.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_tkinter.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/_tkinter_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/_tkinter_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/activate:
--------------------------------------------------------------------------------
1 | # This file must be used with "source bin/activate" *from bash*
2 | # you cannot run it directly
3 |
4 | deactivate () {
5 | # reset old environment variables
6 | if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
7 | PATH="${_OLD_VIRTUAL_PATH:-}"
8 | export PATH
9 | unset _OLD_VIRTUAL_PATH
10 | fi
11 | if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
12 | PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
13 | export PYTHONHOME
14 | unset _OLD_VIRTUAL_PYTHONHOME
15 | fi
16 |
17 | # This should detect bash and zsh, which have a hash command that must
18 | # be called to get it to forget past commands. Without forgetting
19 | # past commands the $PATH changes we made may not be respected
20 | if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
21 | hash -r
22 | fi
23 |
24 | if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
25 | PS1="${_OLD_VIRTUAL_PS1:-}"
26 | export PS1
27 | unset _OLD_VIRTUAL_PS1
28 | fi
29 |
30 | unset VIRTUAL_ENV
31 | if [ ! "$1" = "nondestructive" ] ; then
32 | # Self destruct!
33 | unset -f deactivate
34 | fi
35 | }
36 |
37 | # unset irrelevant variables
38 | deactivate nondestructive
39 |
40 | VIRTUAL_ENV="C:\Users\Administrator\PycharmProjects\zc\venv"
41 | export VIRTUAL_ENV
42 |
43 | _OLD_VIRTUAL_PATH="$PATH"
44 | PATH="$VIRTUAL_ENV/Scripts:$PATH"
45 | export PATH
46 |
47 | # unset PYTHONHOME if set
48 | # this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
49 | # could use `if (set -u; : $PYTHONHOME) ;` in bash
50 | if [ -n "${PYTHONHOME:-}" ] ; then
51 | _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
52 | unset PYTHONHOME
53 | fi
54 |
55 | if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
56 | _OLD_VIRTUAL_PS1="${PS1:-}"
57 | if [ "x(venv) " != x ] ; then
58 | PS1="(venv) ${PS1:-}"
59 | else
60 | if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
61 | # special case for Aspen magic directories
62 | # see http://www.zetadev.com/software/aspen/
63 | PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
64 | else
65 | PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
66 | fi
67 | fi
68 | export PS1
69 | fi
70 |
71 | # This should detect bash and zsh, which have a hash command that must
72 | # be called to get it to forget past commands. Without forgetting
73 | # past commands the $PATH changes we made may not be respected
74 | if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
75 | hash -r
76 | fi
77 |
--------------------------------------------------------------------------------
/zc/venv/Scripts/activate.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | set "VIRTUAL_ENV=C:\Users\Administrator\PycharmProjects\zc\venv"
3 |
4 | if not defined PROMPT (
5 | set "PROMPT=$P$G"
6 | )
7 |
8 | if defined _OLD_VIRTUAL_PROMPT (
9 | set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
10 | )
11 |
12 | if defined _OLD_VIRTUAL_PYTHONHOME (
13 | set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
14 | )
15 |
16 | set "_OLD_VIRTUAL_PROMPT=%PROMPT%"
17 | set "PROMPT=(venv) %PROMPT%"
18 |
19 | if defined PYTHONHOME (
20 | set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%"
21 | set PYTHONHOME=
22 | )
23 |
24 | if defined _OLD_VIRTUAL_PATH (
25 | set "PATH=%_OLD_VIRTUAL_PATH%"
26 | ) else (
27 | set "_OLD_VIRTUAL_PATH=%PATH%"
28 | )
29 |
30 | set "PATH=%VIRTUAL_ENV%\Scripts;%PATH%"
31 |
32 | :END
33 |
--------------------------------------------------------------------------------
/zc/venv/Scripts/deactivate.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | if defined _OLD_VIRTUAL_PROMPT (
4 | set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
5 | )
6 | set _OLD_VIRTUAL_PROMPT=
7 |
8 | if defined _OLD_VIRTUAL_PYTHONHOME (
9 | set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
10 | set _OLD_VIRTUAL_PYTHONHOME=
11 | )
12 |
13 | if defined _OLD_VIRTUAL_PATH (
14 | set "PATH=%_OLD_VIRTUAL_PATH%"
15 | )
16 |
17 | set _OLD_VIRTUAL_PATH=
18 |
19 | set VIRTUAL_ENV=
20 |
21 | :END
22 |
--------------------------------------------------------------------------------
/zc/venv/Scripts/opencv_ffmpeg340_64.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/opencv_ffmpeg340_64.dll
--------------------------------------------------------------------------------
/zc/venv/Scripts/pyexpat.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/pyexpat.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/pyexpat_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/pyexpat_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/python.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/python.exe
--------------------------------------------------------------------------------
/zc/venv/Scripts/python3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/python3.dll
--------------------------------------------------------------------------------
/zc/venv/Scripts/python36.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/python36.dll
--------------------------------------------------------------------------------
/zc/venv/Scripts/python36_d.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/python36_d.dll
--------------------------------------------------------------------------------
/zc/venv/Scripts/python3_d.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/python3_d.dll
--------------------------------------------------------------------------------
/zc/venv/Scripts/python_d.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/python_d.exe
--------------------------------------------------------------------------------
/zc/venv/Scripts/pythonw.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/pythonw.exe
--------------------------------------------------------------------------------
/zc/venv/Scripts/pythonw_d.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/pythonw_d.exe
--------------------------------------------------------------------------------
/zc/venv/Scripts/select.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/select.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/select_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/select_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/sqlite3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/sqlite3.dll
--------------------------------------------------------------------------------
/zc/venv/Scripts/sqlite3_d.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/sqlite3_d.dll
--------------------------------------------------------------------------------
/zc/venv/Scripts/tcl86t.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/tcl86t.dll
--------------------------------------------------------------------------------
/zc/venv/Scripts/tcl86tg.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/tcl86tg.dll
--------------------------------------------------------------------------------
/zc/venv/Scripts/tk86t.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/tk86t.dll
--------------------------------------------------------------------------------
/zc/venv/Scripts/tk86tg.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/tk86tg.dll
--------------------------------------------------------------------------------
/zc/venv/Scripts/unicodedata.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/unicodedata.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/unicodedata_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/unicodedata_d.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/vcruntime140.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/vcruntime140.dll
--------------------------------------------------------------------------------
/zc/venv/Scripts/winsound.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/winsound.pyd
--------------------------------------------------------------------------------
/zc/venv/Scripts/winsound_d.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/venv/Scripts/winsound_d.pyd
--------------------------------------------------------------------------------
/zc/venv/pyvenv.cfg:
--------------------------------------------------------------------------------
1 | home = C:\Python36
2 | include-system-site-packages = true
3 | version = 3.6.4
4 |
--------------------------------------------------------------------------------
/zc/yanzhengma.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/156101zhj/python-PyQt5/f5c56e9d0668ba48f3fb88f36141856c7dba5e39/zc/yanzhengma.png
--------------------------------------------------------------------------------
/zc/zc1.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | MainWindow
4 |
5 |
6 |
7 | 0
8 | 0
9 | 440
10 | 564
11 |
12 |
13 |
14 | MainWindow
15 |
16 |
17 |
18 |
19 |
20 | 50
21 | 96
22 | 121
23 | 21
24 |
25 |
26 |
27 |
28 | 13
29 | 75
30 | true
31 |
32 |
33 |
34 | 输入手机号码:
35 |
36 |
37 |
38 |
39 |
40 | 180
41 | 96
42 | 191
43 | 20
44 |
45 |
46 |
47 |
48 | 13
49 | 75
50 | true
51 |
52 |
53 |
54 |
55 |
56 |
57 | 180
58 | 232
59 | 191
60 | 20
61 |
62 |
63 |
64 |
65 | 13
66 | 75
67 | true
68 |
69 |
70 |
71 |
72 |
73 |
74 | 50
75 | 232
76 | 111
77 | 16
78 |
79 |
80 |
81 |
82 | 13
83 | 75
84 | true
85 |
86 |
87 |
88 | 输入验证码:
89 |
90 |
91 |
92 |
93 |
94 | 180
95 | 272
96 | 191
97 | 20
98 |
99 |
100 |
101 |
102 | 13
103 | 75
104 | true
105 |
106 |
107 |
108 |
109 |
110 |
111 | 50
112 | 272
113 | 121
114 | 20
115 |
116 |
117 |
118 |
119 | 13
120 | 75
121 | true
122 |
123 |
124 |
125 | 输入验证问题?
126 |
127 |
128 |
129 |
130 |
131 | 50
132 | 312
133 | 121
134 | 16
135 |
136 |
137 |
138 |
139 | 13
140 | 75
141 | true
142 |
143 |
144 |
145 | 输入验证答案!
146 |
147 |
148 |
149 |
150 |
151 | 180
152 | 312
153 | 191
154 | 20
155 |
156 |
157 |
158 |
159 | 13
160 | 75
161 | true
162 |
163 |
164 |
165 |
166 |
167 |
168 | 180
169 | 342
170 | 141
171 | 21
172 |
173 |
174 |
175 | 同意服务条款并注册!
176 |
177 |
178 |
179 |
180 |
181 | 180
182 | 362
183 | 185
184 | 41
185 |
186 |
187 |
188 |
189 | Segoe UI
190 | 13
191 | 75
192 | true
193 |
194 |
195 |
196 | 确认
197 |
198 |
199 |
200 |
201 |
202 | 380
203 | 232
204 | 37
205 | 18
206 |
207 |
208 |
209 | ...
210 |
211 |
212 |
213 |
214 |
215 | 180
216 | 127
217 | 191
218 | 20
219 |
220 |
221 |
222 |
223 | 13
224 | 75
225 | true
226 |
227 |
228 |
229 |
230 |
231 |
232 | 50
233 | 127
234 | 121
235 | 21
236 |
237 |
238 |
239 |
240 | 13
241 | 75
242 | true
243 |
244 |
245 |
246 | 输入邮箱号码:
247 |
248 |
249 |
250 |
251 |
252 | 51
253 | 160
254 | 121
255 | 21
256 |
257 |
258 |
259 |
260 | 13
261 | 75
262 | true
263 |
264 |
265 |
266 | 选择性别:
267 |
268 |
269 |
270 |
271 |
272 | 181
273 | 160
274 | 89
275 | 16
276 |
277 |
278 |
279 | name="sex" checked;
280 |
281 |
282 | 男
283 |
284 |
285 |
286 |
287 |
288 | 231
289 | 160
290 | 89
291 | 16
292 |
293 |
294 |
295 | name="sex";
296 |
297 |
298 | 女
299 |
300 |
301 |
302 |
303 |
304 | 180
305 | 196
306 | 191
307 | 20
308 |
309 |
310 |
311 |
312 | 13
313 | 75
314 | true
315 |
316 |
317 |
318 |
319 |
320 |
321 | 50
322 | 196
323 | 121
324 | 21
325 |
326 |
327 |
328 |
329 | 13
330 | 75
331 | true
332 |
333 |
334 |
335 | 上传头像:
336 |
337 |
338 |
339 |
349 |
350 |
351 |
352 |
353 |
354 |
--------------------------------------------------------------------------------
/zc/zc2.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | MainWindow
4 |
5 |
6 |
7 | 0
8 | 0
9 | 523
10 | 556
11 |
12 |
13 |
14 | MainWindow
15 |
16 |
17 |
18 |
19 |
20 | 30
21 | 40
22 | 81
23 | 31
24 |
25 |
26 |
27 |
28 | 20
29 | 75
30 | true
31 |
32 |
33 |
34 | 您好!
35 |
36 |
37 |
38 |
39 |
40 | 100
41 | 140
42 | 71
43 | 31
44 |
45 |
46 |
47 |
48 | 13
49 |
50 |
51 |
52 | 账号:
53 |
54 |
55 |
56 |
57 |
58 | 90
59 | 80
60 | 401
61 | 16
62 |
63 |
64 |
65 |
66 | 13
67 | 75
68 | true
69 |
70 |
71 |
72 | 恭喜您注册成功。请对你的账号做相应的设置!
73 |
74 |
75 |
76 |
77 |
78 | 130
79 | 240
80 | 54
81 | 21
82 |
83 |
84 |
85 |
86 | 13
87 | 75
88 | true
89 |
90 |
91 |
92 | 密码:
93 |
94 |
95 |
96 |
97 |
98 | 180
99 | 240
100 | 191
101 | 20
102 |
103 |
104 |
105 | style={
106 | placeholder="请输入密码"
107 | }
108 |
109 |
110 |
111 |
112 |
113 | 93
114 | 290
115 | 91
116 | 21
117 |
118 |
119 |
120 |
121 | 13
122 | 75
123 | true
124 |
125 |
126 |
127 | 确认密码:
128 |
129 |
130 |
131 |
132 |
133 | 180
134 | 290
135 | 191
136 | 20
137 |
138 |
139 |
140 | placeholder:“密码由6-20位数字或字母组成”;
141 |
142 |
143 |
144 |
145 |
146 | 240
147 | 160
148 | 221
149 | 16
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 | 180
160 | 330
161 | 185
162 | 41
163 |
164 |
165 |
166 | 登录
167 |
168 |
169 |
170 |
171 |
172 | 170
173 | 130
174 | 201
175 | 51
176 |
177 |
178 |
179 | font: 75 italic 24pt "幼圆";
180 | background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(145, 241, 249, 255), stop:1 rgba(255, 255, 255, 255));
181 |
182 |
183 |
184 |
194 |
195 |
196 |
197 |
198 |
199 |
--------------------------------------------------------------------------------
/zc/zc3.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | MainWindow
4 |
5 |
6 |
7 | 0
8 | 0
9 | 523
10 | 555
11 |
12 |
13 |
14 | MainWindow
15 |
16 |
17 |
18 |
19 |
20 | 30
21 | 40
22 | 81
23 | 31
24 |
25 |
26 |
27 |
28 | 20
29 | 75
30 | true
31 |
32 |
33 |
34 | 您好!
35 |
36 |
37 |
38 |
39 |
40 | 100
41 | 140
42 | 71
43 | 31
44 |
45 |
46 |
47 |
48 | 13
49 |
50 |
51 |
52 | 账号:
53 |
54 |
55 |
56 |
57 |
58 | 90
59 | 80
60 | 401
61 | 16
62 |
63 |
64 |
65 |
66 | 13
67 | 75
68 | true
69 |
70 |
71 |
72 | 恭喜您注册成功。请对你的账号做相应的设置!
73 |
74 |
75 |
76 |
77 |
78 | 130
79 | 240
80 | 54
81 | 21
82 |
83 |
84 |
85 |
86 | 13
87 | 75
88 | true
89 |
90 |
91 |
92 | 密码:
93 |
94 |
95 |
96 |
97 |
98 | 180
99 | 240
100 | 191
101 | 20
102 |
103 |
104 |
105 | style={
106 | placeholder="请输入密码"
107 | }
108 |
109 |
110 |
111 |
112 |
113 | 93
114 | 290
115 | 91
116 | 21
117 |
118 |
119 |
120 |
121 | 13
122 | 75
123 | true
124 |
125 |
126 |
127 | 确认密码:
128 |
129 |
130 |
131 |
132 |
133 | 180
134 | 290
135 | 191
136 | 20
137 |
138 |
139 |
140 | placeholder:“密码由6-20位数字或字母组成”;
141 |
142 |
143 |
144 |
145 |
146 | 240
147 | 160
148 | 221
149 | 16
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 | 180
160 | 330
161 | 185
162 | 41
163 |
164 |
165 |
166 | 登录
167 |
168 |
169 |
170 |
171 |
172 | 170
173 | 130
174 | 201
175 | 51
176 |
177 |
178 |
179 | font: 75 italic 24pt "幼圆";
180 | background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(145, 241, 249, 255), stop:1 rgba(255, 255, 255, 255));
181 |
182 |
183 |
184 |
185 |
186 | 380
187 | 280
188 | 131
189 | 41
190 |
191 |
192 |
193 |
194 | 华文楷体
195 | 32
196 | 9
197 | false
198 | false
199 |
200 |
201 |
202 | color: rgb(255, 0, 0);
203 | font: 75 32pt "华文楷体";
204 |
205 |
206 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
207 | <html><head><meta name="qrichtext" content="1" /><style type="text/css">
208 | p, li { white-space: pre-wrap; }
209 | </style></head><body style=" font-family:'华文楷体'; font-size:32pt; font-weight:72; font-style:normal;">
210 | <p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html>
211 |
212 |
213 |
214 |
224 |
225 |
226 |
227 |
228 |
229 |
--------------------------------------------------------------------------------