Python not seeing mirc log files, why?
Hyperion
AgentSmith at Matrix..com
Tue May 20 19:09:17 EDT 2003
Hello all.
I am trying to write a script for find and search within a log file.
The log files in question are from mirc the irc client.
I am using ActivePython 2.2 on windows xp.
The code I am using so far is:....
asking = raw_input("what is the file? ")
reading_file = open(asking, 'r')
text_infile=''
text_infile = reading_file.read()
reading_file.close()
print text_infile
Now this will work and open a txt file called,
one.txt
at
C:\one.txt
but it wont work with the mirc log files at:..
C:\Program Files\mIRC\logs
were the log files are like:..
#channel.EFNet.txt.
so it would be:...
C:\Program Files\mIRC\logs\channel.EFNet.txt
I am assuming it is .txt extension which it is because they are text
files.
I have even tried renaiming the logfiles to take out the, '#' character
so that they are just, 'channel.EFNet.txt' but it didn't work.
Has anyone got any ideas as to why it is not working?
The error I keep getting is this IO error:..
Traceback (most recent call last):
File
"C:\Python22\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
line 301, in RunScript
exec codeObject in __main__.__dict__
File "C:\Python-scripts\readingscript.py", line 5, in ?
reading_file = open(asking, 'r')
IOError: [Errno 2] No such file or directory: 'C:\\Program
Files\\mIRC\\logs\\webfringe.efnet.txt'
Thanks in advance for any help.
Hyperion
More information about the Python-list
mailing list