start new:
tmux
start new with session name:
tmux new -s myname
#!/usr/bin/env python | |
# coding: utf-8 | |
# How Twisted's inlineCallbacks work? | |
# If you use it but don't know exactly what it does, | |
# and didn't understand the code shipped with Twisted, | |
# keep reading. | |
import types, functools | |
from twisted.python import failure | |
from twisted.web.client import getPage |
Sete Atitudes para Hackear a Indústria de Software | |
By Klaus Wuestefeld | |
1) Torne-se excelente. | |
Seja realmente bom em alguma coisa. Não fique só choramingando ou | |
querendo progredir às custas dos outros. Não pense q pq vc sentou 4 | |
anos numa faculdade ouvindo um professor falar sobre software q vc | |
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo |
import sys | |
from StringIO import StringIO | |
class redirect_stdout: | |
def __init__(self, target): | |
self.stdout = sys.stdout | |
self.target = target | |
def __enter__(self): |
from collections import OrderedDict | |
d = OrderedDict() | |
d["ble"] = "bla" | |
d["bla"] = "x" |
def hello(name: str, age: int) -> int: | |
print(name, age) | |
hello.__annotations__ |
a = b"Heelo World" | |
v = memoryview(a) |
import io | |
f = io.FileIO("texto.txt", "w") | |
f.write("ble") | |
f.close() |
from concurrent.futures import ProcessPoolExecutor | |
with ProcessPoolExecutor(max_workers=4) as executor: | |
future = executor.submit(pow, 323, 1235) | |
print(future.result()) |
from concurrent.futures import ThreadPoolExecutor | |
with ThreadPoolExecutor(max_workers=1) as executor: | |
future = executor.submit(pow, 323, 1235) | |
print(future.result()) |