print('The accounts will be deleted from memory in 5 seconds')
time.sleep(5)
accounts.clear()
print('The accounts have been deleted from memory')
time.sleep(5)
print('End of script')
if __name__ == '__main__':
    read_file('ips.txt')
Как освободить память после открытия файла в Python