473,385 Members | 1,331 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Exception has occurred: AttributeError

import re
from collections import OrderedDict
file = open(input("Input-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()##to remove the newlines when printing
s = tempkey
#s.sort()
#print("temp", tempkey)
key.append(tempkey.replace("Startpoint: ", ""))##replacing / removing the 'Startpoint:'
keyapp=True
if keyapp:
a=key.append(tempkey.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
Jun 7 '22 #1
0 8871

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Harry | last post by:
I need to get hold of somehow the line no that an exception occurred at so as to log it using log4j. My ConversionPattern is set to - log4j.appender.stdout.layout.ConversionPattern=%5p (%F:%L)...
0
by: psaban | last post by:
Getting an exception occurred error with the following code: Dim rgstcustConnect 'as Connection set rgstcustConnect=server.createobject("adodb.connection") rgstcustConnect.open...
2
by: chris.higginson | last post by:
Hi, I'm running SQL Server Version 8.00.194 on Windows 2000. I am am running this query: select TOP 2000 TheoVolImplied from OptionTrades where ReutersSymbol = 'IBM.N' and TheoVolImplied...
1
by: Pardhasaradhy | last post by:
Hi, Please see the following error and revert back as early as possible. I am getting this once I request for the asp.net page. Server Error in '/tanishq' Application. Timed out waiting for...
0
by: Marco Viana | last post by:
Hi, I'm developing an ASP.NET application with Visual Studio .NET 2003 in a Win XP Professional, .NET Framework 1.1 and IIS 5.1 computer with all the lattest patches. When testing a page...
6
by: Si | last post by:
I get the following error from the code below: Error Type: (0x80020009) Exception occurred. /diary.asp, line 53 The specific part that causes the exception is when I try to access...
1
by: maidonical | last post by:
I am trying to run "select * from <table> where <columnname> = 0.0" in query analyzer <columnname> is a float I get the following error: Server: Msg 3628, Level 16, State 1, Line 1 A floating...
1
by: Richard Gordon | last post by:
I've got a fatal bug using Parente's pyTTS with Python 2.3 on Windoze 32 using MS SAPI 5.1 and Hammond's win32 module. The test program is import pyTTS tts = pyTTS.Create() tts.Speak('Hello...
6
by: Massa Batheli | last post by:
sql server 2000 sp4 build 2184 runs stats with maintenance plan sp_msforeachtable stored procedure updating full stats for each table and the results are identical A floating point...
0
by: Andrzej Lipski | last post by:
Hello I am developing a Windows Ce 5.0 mobile application. I followed the example shown at : Creating Self-Updating Applications With the .NET Compact Framework...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.