Hi all,
I'm fairly new to programming in Python, and I have been getting on pretty well. I had a little working program compiled from old code snippets I had found online, converted to working 3.x code and combined together with some of my own ideas to create simple apps.
Now, for no apparent reason, the code no longer works. Errors are being generated and I am very confused as the code had not been edited in any way. There are 2 issues I am getting at the moment, which I'll detail below along with the relevant code sections.
Issue 1 -
sys.stdout.writelines no longer works and gives the following error:
Message File Name Line Position
Traceback
<module> C:\Python31\Programs\Build Information Consistency Checker\abicc.py 54
createQuickView C:\Python31\Programs\Build Information Consistency Checker\abiccfunc.py 68
AttributeError: 'DebugOutput' object has no attribute 'writelines'
Highlighted code:
sys.stdout.writelines(added_dirs)
I can provide the full function code if necessary, but the error tells me the sys.stdout doesn't have an atribute called writelines. It did last week and has been working for a few weeks now.
*****************************************************
Issue 2 - EOF when reading line which is awaiting text input. These files were all working but now have suddenly just stopped. Starting with the output of the program as displayed in the interpreter:
Build & Install Consistency Checker
***********************************
Microsoft Windows XP Service Pack 3 (build 2600)
Intel(R) Pentium(R) M processor 1.70GHz
Browsers:
Mozilla Firefox 3.5.3 (en-GB)
Internet Explorer 8.0.6001.18702
RAM : 503Mb total
RAM : 142Mb free
System HD : 20Gb free
Page File : 435Mb free
Please choose install to check for consistency:
1. ICM Database
9. Exit
Traceback (most recent call last):
File "C:\Python31\Programs\BUILDI~1\abicc.py", line 49, in <module>
select = menu()
File "C:\Python31\Programs\BUILDI~1\abicc.py", line 26, in menu
select = input("\t")
EOFError: EOF when reading a line
Process "Python Interpreter" terminated, ExitCode: 00000001
code of function that is providing error:
def menu():
print ('''
Please choose install to check for consistency:
1. ICM Database
9. Exit
''')
select = input("\t")
return select #Returns users choice from function
Both of these are from different modules of a program I am working on, but they were all working fine, with no editing they have stopped working, generating these errors. Have there been any changes to affect my code, bearing in mind I have not updated my python.
Thanks in advance for your assistance
Andy