#!/usr/bin/python encoding: utf-8 -- coding: utf8 --
import re
list_to_test = ['# ', '# conf', 'NAME="Ubuntu"', 'VERSION="14.04.3 LTS, Trusty Tahr"']
for member in list_to_test:
if re.search('^#+.*', member) is not None:
list_to_test.remove(member)
#!/usr/bin/pythonencoding: utf-8-*- coding: utf8 --
import re
from copy import deepcopy
old_list = ['# ', '# conf', 'NAME="Ubuntu"', 'VERSION="14.04.3 LTS, Trusty Tahr"']
new_list = deepcopy(old_list)
for member in new_list:
if re.search('^#+.', member) is not None:
old_list.remove(member)
#!/usr/bin/pythonencoding: utf-8-*- coding: utf8 --
import re
old_list = ['# ', '# conf', 'NAME="Ubuntu"', 'VERSION="14.04.3 LTS, Trusty Tahr"']
new_list = old_list[:]
for member in new_list:
if re.search('^#+.', member) is not None:
old_list.remove(member)