Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5a6e492

Browse files
committed
Libraries
1 parent 2db6d42 commit 5a6e492

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,7 @@ Plot
12111211
```python
12121212
# $ pip3 install matplotlib
12131213
from matplotlib import pyplot
1214+
12141215
pyplot.plot(<data_1> [, <data_2>, ...])
12151216
pyplot.show()
12161217
pyplot.savefig(<filename>, transparent=True)
@@ -1223,6 +1224,7 @@ Progress Bar
12231224
# $ pip3 install tqdm
12241225
from tqdm import tqdm
12251226
from time import sleep
1227+
12261228
for i in tqdm(range(100)):
12271229
sleep(0.02)
12281230
for i in tqdm([1, 2, 3]):
@@ -1237,6 +1239,7 @@ Table
12371239
# $ pip3 install tabulate
12381240
import csv
12391241
from tabulate import tabulate
1242+
12401243
with open(<filename>, newline='') as csv_file:
12411244
reader = csv.reader(csv_file, delimiter=';')
12421245
headers = [a.title() for a in next(reader)]
@@ -1273,6 +1276,7 @@ Image
12731276
```python
12741277
# $ pip3 install pillow
12751278
from PIL import Image
1279+
12761280
width, height = 100, 100
12771281
img = Image.new('L', (width, height), 'white')
12781282
img.putdata([255*a/(width*height) for a in range(width*height)])
@@ -1292,6 +1296,7 @@ Audio
12921296
#### Saves a list of floats with values between 0 and 1 to a WAV file:
12931297
```python
12941298
import wave, struct
1299+
12951300
frames = [struct.pack('h', int((a-0.5)*60000)) for a in <list>]
12961301
wf = wave.open(<filename>, 'wb')
12971302
wf.setnchannels(1)
@@ -1429,6 +1434,7 @@ timeit('"-".join(str(a) for a in range(100))',
14291434
# $ pip3 install pycallgraph
14301435
from pycallgraph import output, PyCallGraph
14311436
from datetime import datetime
1437+
14321438
graph = output.GraphvizOutput()
14331439
time_str = datetime.now().strftime('%Y%m%d%H%M%S')
14341440
graph.output_file = f'profile-{time_str}.png'

0 commit comments

Comments
 (0)