from random import randrange from random import shuffle with open hw2

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
from random import randrange
from random import shuffle
with open ('hw2.2.csv', 'r') as f:
lines = f.readlines()
dings = [randrange(32767) for elem in range(10)]
macs = [randrange(32767) for elem in range(10)]
print(macs, dings)
macs_n_dings = zip(macs, dings)
with open(f'hw2/input.csv', 'w') as v:
v.write('macs,dings\n')
for mac, ding in macs_n_dings:
row = f'{mac},{ding}\n'
print(row)
v.write(row)
with open(f'hw2/{mac}.txt', 'w') as f:
f.write(f'{ding}')