Follow the instructions here
sudo service docker start
import asyncio | |
from pathlib import Path | |
from typing import Optional | |
from watchdog.events import FileSystemEvent, FileSystemEventHandler | |
from watchdog.observers import Observer | |
class _EventHandler(FileSystemEventHandler): | |
def __init__(self, queue: asyncio.Queue, loop: asyncio.BaseEventLoop, |
"""Demonstration of server-sent events with Tornado. To see the | |
stream, you can either point your browser to ``http://localhost:8080`` | |
or use ``curl`` like so:: | |
$ curl http://localhost:8080/events | |
""" | |
import signal | |
from tornado import web, gen |
"""This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the | |
software to the public domain. We make this dedication for the benefit |
"""Simple demonstration of using ZMQ's Curve authentication. | |
This demo is adapted from the examples given in the `PyZMQ repository`__. Key | |
differences include: | |
* Using ``setsockopt`` to set Curve parameters instead of setting attributes | |
directly (help out your IDE!) | |
* Integration with ``asyncio`` | |
__ https://github.com/zeromq/pyzmq/tree/master/examples |
Follow the instructions here
sudo service docker start
"""Simple demo of using Flask with aiohttp via aiohttp-wsgi's | |
WSGIHandler. | |
""" | |
import asyncio | |
from aiohttp import web | |
from aiohttp_wsgi import WSGIHandler | |
from flask import Flask, render_template |
1. Install Scoop
Scoop is a command-line installer for Windows -- it's like Homebrew for Windows. It installs programs from the command line with a minimal amount of friction. More info about scoop is available here: https://gist.github.com/andrew-rietz/66e4ebcf96f85b6618b078ebe00104b1
To install, open PowerShell and execute the following command:
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
2. Use Scoop to install some awesome helper applications
We'll use Scoop to install a couple applications: posh-git and starship. Posh-git adds a lot of the convenience features you get in git bash directly into PowerShell (autocompletion, etc.). We'll also install starship.rs: a customizeable prompt for many of the common shells (Bash, Fish, Zsh, PowerShell).
__pycache__ | |
*.pyc | |
*.ipynb | |
.ipynb_checkpoints | |
*.json | |
*~ |
class Manager(object): | |
classes = set() | |
class Meta(type): | |
def __new__(cls, name, bases, d): | |
print("name:", name, "\nbases:", bases, "\ndict: ", d) | |
if name is not "Base": | |
Manager.classes.add(d['data']) | |
return type.__new__(cls, name, bases, d) |
from multiprocessing import Event, Process, Queue | |
import time | |
import zmq | |
class BaseActor(Process): | |
ready = Event() | |
def handle(self, msg): | |
print("dt =", time.time() - msg['timestamp']) |