import re
from collections import OrderedDict
file = open(input("Inp ut-file name : ") , "r")
fi = file.readlines( )## convert to list of lines
key=[]
val=[]
keyapp=False
for line in fi:
if re.match(r'^[^\n(E|P):]*:\s[EXINTF_DATA\d]*\d',line):
#print(line)
tempkey = line.strip()##t o remove the newlines when printing
s = tempkey
#s.sort()
#print("temp", tempkey)
key.append(temp key.replace("St artpoint: ", ""))##repla cing / removing the 'Startpoint:'
keyapp=True
if keyapp:
a=key.append(te mpkey.replace(" Startpoint: ", ""))
b=a.OrderedDict .fromkeys(s)
print(b)
'NoneType' object has no attribute 'OrderedDict'.
could anyone please help me on how to fix it
from collections import OrderedDict
file = open(input("Inp ut-file name : ") , "r")
fi = file.readlines( )## convert to list of lines
key=[]
val=[]
keyapp=False
for line in fi:
if re.match(r'^[^\n(E|P):]*:\s[EXINTF_DATA\d]*\d',line):
#print(line)
tempkey = line.strip()##t o remove the newlines when printing
s = tempkey
#s.sort()
#print("temp", tempkey)
key.append(temp key.replace("St artpoint: ", ""))##repla cing / removing the 'Startpoint:'
keyapp=True
if keyapp:
a=key.append(te mpkey.replace(" Startpoint: ", ""))
b=a.OrderedDict .fromkeys(s)
print(b)
'NoneType' object has no attribute 'OrderedDict'.
could anyone please help me on how to fix it