Skip to content

YanB25/p2p-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

p2p-demo

a p2p demo, computer network project. based on Python3

项目主页:

http://wangyf.top/p/pre/p2p-demo

瓶颈

QT运行时会阻塞进程。
需要分离UI线程和任务线程

Usage

$ python src/UI.py

or exlicitely

$ python3 src/UI.py

backend

define a class and inherit from QThread

from QtPy5.QtCore import QThread
class Task(QThread):
    pipe = pyqtSignal(str)
    def __init__():
        pass

then define function run

class Task(QThread):
    ...
    def run(self, *arg):
        do-your-task()
        self.pipe.emit("hello world")

what you send in self.pipe.emit()would be sent to UI and shown properly.

About

a p2p demo, computer network project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages