Too Much Space . So i reduce

This commit is contained in:
minoplhy 2021-08-10 12:26:44 +07:00
parent 91b6e70887
commit c8696504c9
2 changed files with 23 additions and 2 deletions

View File

@ -26,4 +26,25 @@ def add_file(incoming,excluded_in):
with open(incoming, 'w') as f:
f.writelines(set(lines))
crawler.sort(incoming)
os.remove(excluded_in)
os.remove(excluded_in)
def remove(incoming,input):
with open(incoming, 'r') as f:
lines = f.read().split()
with open(incoming, 'w') as f:
for line in lines:
if line.startswith(input) and input in line:
f.write(line.replace(input ,''))
elif not line.startswith(input):
f.write('\n'.join([line + '\n']))
with open(incoming ,'r') as f:
lines = f.read().split()
with open(incoming ,'w') as f:
for line in lines:
if line.strip():
f.write('\n'.join([line + '\n']))
with open(incoming, 'r') as f:
lines = set(f.readlines())
with open(incoming, 'w') as f:
f.writelines(set(lines))
crawler.sort(incoming)

View File

@ -37,7 +37,7 @@ def hostsbuilding(excluded ,incoming ,output):
f.write('ff02::1 ip6-allnodes\n')
f.write('ff02::2 ip6-allrouters\n')
f.write('ff02::3 ip6-allhosts\n')
f.write('0.0.0.0 0.0.0.0\n\n\n')
f.write('0.0.0.0 0.0.0.0\n\n')
for line in lines:
if line.strip() and not line in exclude and not line.startswith('#'):