$ gpg --gen-key Please select what kind of key you want:
import socketserver | |
import sys | |
import time | |
class EchoTCPHandler(socketserver.StreamRequestHandler): | |
def handle(self): | |
data = self.rfile.readline().strip().decode('UTF-8') | |
print('[ECHO SERVER] Received data: {}'.format(data)) | |
self.wfile.write('Echo: {}'.format(data).encode('UTF-8')) |
import sys | |
import py | |
import pytest | |
from xprocess import ProcessStarter | |
from servers import ItalicTCPHandler, EchoTCPHandler | |
python_executable_full_path = sys.executable | |
python_server_script_full_path = py.path.local(__file__).dirpath("servers.py") |
Data are observation of real-world phenomena. E.g. stock market data might involve observations of daily stock prices, announcements of earnings by individual companies, opinion articles from pundits.
Data can help us answer some questions. E.g. which stocks should I invest in? The tasks are how we get to the answers.
This document shows how to create a Debian package for an existing Python library.
Before doing this, it is a good idea to check if there isn't an existing Debian package for the library to be packaged.
For Debian: https://www.debian.org/distrib/packages
For Ubuntu: https://packages.ubuntu.com/
In front of you are 3 boxes. One box contains only apples, another box contains only oranges, and the last contains both apples and oranges. The first box has the label "apples," the second "oranges," and the third "apples and oranges." Unfortunately all of the labels are wrong. Your job is to fix the labels. You are not allowed to peek inside any of the boxes. But you can ask for a sample from any box. You point to a box, and you get a fruit from that box. What is the minimum number of samples you need to label all of the boxes correctly?
""" | |
Install greenlet before running this: pip install greenlet | |
""" | |
from greenlet import greenlet | |
class GUIFramework: | |
""" | |
This class simulates a GUI framework, that has its own main loop. | |
For simplicity, the loop is just waiting for user input from stdin, and when a key | |
is pressed, a user-defined callback is invoked. |
from datetime import datetime | |
import socket | |
import sys | |
import time | |
def run(): | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.connect(('localhost', 4444)) | |
msg = "[{}] Hello world!!".format(str(datetime.now())).encode("UTF-8") |