This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import trio | |
import gi | |
def gtk_main_trio_run(main_window, trio_func): | |
from gi.repository import GLib, Gtk | |
_outcome = None | |
window_close_scope = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import trio | |
import urwid | |
def exit_on_q(key): | |
if key in ('q', 'Q'): | |
raise urwid.ExitMainLoop() | |
class QuestionBox(urwid.Filler): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import trio | |
import urwid | |
import trwid | |
async def job(): | |
for n in range(1000): | |
await trio.sleep(0.02) | |
pb.set_completion(n) | |
await trio.sleep(0.1) | |
return "OK!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
import sys | |
import csv | |
open('out.csv', 'wb').writelines(line for line in open('in.csv', 'rb') if "@gmail.com" in line) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import re | |
import urllib2 | |
import urllib | |
import json | |
from twisted.internet import reactor, task, defer, protocol | |
from twisted.python import log | |
from twisted.words.protocols import irc | |
from twisted.web.client import getPage | |
from twisted.application import internet, service |