patterns shit

This commit is contained in:
2018-12-18 13:35:11 +01:00
parent 5780d869cf
commit 284026907b
11 changed files with 4801072 additions and 0 deletions

40
patterns/realcomb.py Normal file
View File

@@ -0,0 +1,40 @@
#it just actually combines files by appending the lines of one to another
import sys, os
if len(sys.argv) < 2:
print("usage python blabal.py file1 ....")
sys.exit()
files = []
for i,x in enumerate(sys.argv):
if i > 0:
files.append(x)
lines = []
title = ""
for f in files:
title = title+f
with open(f, "r") as infile:
lines.extend(infile.readlines())
for i,l in enumerate(lines):
if " " in l:
temp = l
lines.pop(i)
temp.split(" ")
lines.extend(temp)
with open(title, "w") as outfile:
outfile.writelines(lines)