how to create qthread in pyqt5

# go to the link below, i've written a script for testing QThread
# it have comments about what it does for different parts of the code
# You can copy and pase it and run it
https://gist.github.com/Orizzu/c95c170bdc88f458aa527986a2c616f6

Here is what the above code is Doing:
1. It creates a QThread object
2. It creates a Worker object
3. It moves the Worker object to the QThread object
4. It connects the Worker object’s signal to the QThread object’s finished signal
5. It connects the Worker object’s signal to the QThread object’s started signal
6. It starts the QThread object
7. It waits for the QThread object to finish
8. It prints out the Worker object’s result
9. It deletes the QThread object
10. It deletes the Worker object