@@ -1232,14 +1232,11 @@ for i in tqdm([1, 2, 3]):
12321232
12331233Table
12341234-----
1235+ #### Prints CSV file as ASCII table:
12351236``` python
12361237# $ pip3 install tabulate
12371238from csv import reader
12381239from tabulate import tabulate
1239- ```
1240-
1241- #### Prints CSV file as ASCII table:
1242- ``` python
12431240with open (< filename> , newline = ' ' ) as csv_file:
12441241 reader = reader(csv_file, delimiter = ' ;' )
12451242 headers = [a.title() for a in next (reader)]
@@ -1276,7 +1273,6 @@ Image
12761273``` python
12771274# $ pip3 install pillow
12781275from PIL import Image
1279-
12801276width, height = 100 , 100
12811277img = Image.new(' L' , (width, height), ' white' )
12821278img.putdata([255 * a/ (width* height) for a in range (width* height)])
@@ -1296,7 +1292,6 @@ Audio
12961292#### Saves a list of floats with values between 0 and 1 to a WAV file:
12971293``` python
12981294import wave, struct
1299-
13001295frames = [struct.pack(' h' , int ((a- 0.5 )* 60000 )) for a in < list > ]
13011296wf = wave.open(< filename> , ' wb' )
13021297wf.setnchannels(1 )
@@ -1434,7 +1429,6 @@ timeit('"-".join(str(a) for a in range(100))',
14341429# $ pip3 install pycallgraph
14351430from pycallgraph import output, PyCallGraph
14361431from datetime import datetime
1437-
14381432graph = output.GraphvizOutput()
14391433time_str = datetime.now().strftime(' %Y%m%d %H%M%S' )
14401434graph.output_file = f ' profile- { time_str} .png '
0 commit comments