Python not seeing mirc log files, why?

Irmen de Jong irmen at -NOSPAM-REMOVETHIS-xs4all.nl
Tue May 20 19:25:47 EDT 2003


Hyperion wrote:
> 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=''
^^^^^^^^^^^^^^^^ this is actually not needed...
> text_infile = reading_file.read()
> reading_file.close()
> 
> print text_infile


> I am assuming it is .txt extension which it is because they are text
> files.

*assume* it is .txt extension? If mIRC writes log files with
.txt extension, then you're safe, but you have to be *sure* the
file has this extension. It could very well be .log

Try (in explorer) tools->folder options->view->hide extensions...
make sure it is *not* checked. That shows you the extension
for all files.

> Has anyone got any ideas as to why it is not working?

Either the files don't have a .txt extension,
or they are locked by mirc? Close mirc before running
the script?

--Irmen de Jong





More information about the Python-list mailing list