Skip to content

Instantly share code, notes, and snippets.

View leixingyu's full-sized avatar
👋
Let's Connect!

Xingyu Lei leixingyu

👋
Let's Connect!
View GitHub Profile
@leixingyu
leixingyu / server.py
Last active December 25, 2022 16:14 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET and POST requests
"""
Example usage to get/post data on server from client.py
```
import requests
url = 'http://localhost:8000'
def get(url):
@leixingyu
leixingyu / chatroom.py
Created December 24, 2022 03:34 — forked from tyt2y3/chatroom.py
Simple chatroom in Python, upon BaseHTTPServer and long polling
'''
Simple chatroom
Reference
https://docs.python.org/2/library/threading.html
http://blog.oddbit.com/2013/11/23/long-polling-with-ja/
http://zulko.github.io/blog/2013/09/19/a-basic-example-of-threads-synchronization-in-python/
http://www.laurentluce.com/posts/python-threads-synchronization-locks-rlocks-semaphores-conditions-events-and-queues/
'''
import time
@leixingyu
leixingyu / Dock.py
Last active July 16, 2022 15:56 — forked from mottosso/Dock.py
Simple way to dock Qt widgets to Maya 2017+
from builtins import int
from shiboken2 import wrapInstance
from maya import cmds, OpenMayaUI as omui
from Qt import QtWidgets, QtCore
from Qt import _loadUi
def Dock(Widget, show=True):
name = Widget.__class__.__name__