You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
505 B
23 lines
505 B
7 years ago
|
#!/usr/bin/python3
|
||
|
|
||
|
import sys
|
||
|
import os
|
||
|
|
||
|
filename = sys.argv[1]
|
||
|
dirname = sys.argv[2]
|
||
|
temp = []
|
||
|
for i in os.listdir(dirname):
|
||
|
temp.append(int(i))
|
||
|
cards = sorted(temp)
|
||
|
|
||
|
with open(filename, 'a') as op:
|
||
|
for i in cards:
|
||
|
card = str(i)
|
||
|
op.write(card + ":")
|
||
|
with open(dirname + "/" + card, 'r') as ip:
|
||
|
payload = ""
|
||
|
for line in ip:
|
||
|
payload = payload + line[:-1] + ','
|
||
|
payload = payload[:-1]
|
||
|
op.write(payload + '\n')
|