IP_List_generator : [experimental] combine module init

This commit is contained in:
unknown 2022-10-08 01:11:19 +07:00
parent 4c2d452ea9
commit f094587b5d
Signed by: minoplhy
GPG Key ID: 90667A59A9908AEC
1 changed files with 25 additions and 0 deletions

View File

@ -54,6 +54,31 @@ def htaccess(input, output):
else:
pass
"""
Must be in IP List Format!!
"""
def combine(destination, fileadd):
# Append List
with open(fileadd ,'r') as f:
readinput = f.read().splitlines()
with open(destination, 'a') as f:
for line in readinput:
f.write(line + "\n")
f.close()
# Clear Duplicated
with open(destination, 'r') as f:
lines = set(f.readlines())
with open(destination, 'w') as f:
f.writelines(set(lines))
f.close()
# Sort
with open(destination, 'r') as f:
lines = sorted(f.readlines())
with open(destination, 'w') as f:
for line in lines:
f.write(line)
def BuildDate():
UTC = pytz.utc
date = datetime.datetime.now(UTC)