From a31cc71e978e5c907c084122392013ff2a38fd79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= <sornjure@gmail.com> Date: Sun, 30 Dec 2018 03:11:35 +0100 Subject: [PATCH] Libraries --- README.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/README.md b/README.md index 2776856..ad4cab8 100644 --- a/README.md +++ b/README.md @@ -1232,14 +1232,11 @@ for i in tqdm([1, 2, 3]): Table ----- +#### Prints CSV file as ASCII table: ```python # $ pip3 install tabulate from csv import reader from tabulate import tabulate -``` - -#### Prints CSV file as ASCII table: -```python with open(<filename>, newline='') as csv_file: reader = reader(csv_file, delimiter=';') headers = [a.title() for a in next(reader)] @@ -1276,7 +1273,6 @@ Image ```python # $ pip3 install pillow from PIL import Image - width, height = 100, 100 img = Image.new('L', (width, height), 'white') img.putdata([255*a/(width*height) for a in range(width*height)]) @@ -1296,7 +1292,6 @@ Audio #### Saves a list of floats with values between 0 and 1 to a WAV file: ```python import wave, struct - frames = [struct.pack('h', int((a-0.5)*60000)) for a in <list>] wf = wave.open(<filename>, 'wb') wf.setnchannels(1) @@ -1434,7 +1429,6 @@ timeit('"-".join(str(a) for a in range(100))', # $ pip3 install pycallgraph from pycallgraph import output, PyCallGraph from datetime import datetime - graph = output.GraphvizOutput() time_str = datetime.now().strftime('%Y%m%d%H%M%S') graph.output_file = f'profile-{time_str}.png'