I'm running Win 7, and the stuff that got it to work on your Win 7 system 
didn't work on mine. I think I'll just config Thunderbird to store its mail in 
the Python directory and be done with it. My patience has run out on this 
project. But, thanks for getting me to the point that it actually can work for 
me; I'd have never figured it out on my own.

--- In FairfieldLife@yahoogroups.com, Bhairitu  wrote:
>
> Right click on the pycount.py icon and you'll see Open with IDLE.  
> Select that as it is the IDE (editor) for Python.  It will open the 
> script and from the menu select Run and Run Module to run the script.  
> This way the Window won't close and it doesn't matter where the script 
> is.  I moved my FFL mbox file over and it worked fine.  When I copied it 
> to another directory it had the same error you had until I put the extra 
> slash behind the volume label and then it worked. So put that extra 
> slash in like this.
> 
> mbox = 
> "C:\\Users\alex\AppData\Roaming\Thunderbird\Profiles\57d35iy6.default\Mail\pop.googlemail.com\Inbox"
> 
> 
> I hadn't used Python on Windows for awhile and forgot it has an IDE 
> (editor) for it.  Need to install it on Linux (it's in python-tools).
> 
> On 01/23/2013 12:34 PM, Alex Stanley wrote:
> >
> > --- In FairfieldLife@yahoogroups.com, Bhairitu  wrote:
> >>
> >> Try putting quotes around it.  You may also need an extra slash after
> >> the C:  You could also just copy the Inbox file to the same directory as
> >> the script for testing.  In that case mbox = Inbox should work.
> >>
> >> Simple python script to test would be:
> >>
> >> mbox = 
> >> "C:\Users\alex\AppData\Roaming\Thunderbird\Profiles\57d35iy6.default\M
> >> ail\pop.googlemail.com\Inbox"
> >>
> >> print mbox
> >>
> >> # it should print the path.
> >>
> > Ok, now we're getting somewhere. I had put Python's install directory in 
> > the system PATH so that I could call the Python executable from any 
> > directory. I figured it would be great if I could run the script in a 
> > command window opened in the directory where Thunderbird holds its Inbox. 
> > All along, the script has been in the same directory as the Inbox, but no 
> > go.
> >
> > So, I copied the Inbox file and the script to the Python install directory 
> > and edited the script like this:
> >
> > mbox = "C:\Python27\Inbox"
> >
> > And, it worked perfectly. That establishes the proper mbox line syntax, 
> > i.e., file path in quotes. So, I went back to the Thunderbird Inbox 
> > directory, edited the script with the Inbox path in quotes, and the script 
> > generates this error:
> >
> >
> > C:\Users\alex\AppData\Roaming\Thunderbird\Profiles\57d35iy6.default\Mail\pop.goo
> > glemail.com>python pcount.py
> > Getting posts...
> >
> > Traceback (most recent call last):
> >    File "pcount.py", line 46, in 
> >      for message in mailbox.mbox(mbox):
> >    File "C:\Python27\lib\mailbox.py", line 784, in __init__
> >      _mboxMMDF.__init__(self, path, factory, create)
> >    File "C:\Python27\lib\mailbox.py", line 550, in __init__
> >      f = open(self._path, 'rb+')
> > IOError: [Errno 22] invalid mode ('rb+') or filename: 
> > 'C:\\Users\x07lex\\AppData
> > \\Roaming\\Thunderbird\\Profiles\\57d35iy6.default\\Mail\\pop.googlemail.com\\In
> > box'
> >
> > C:\Users\alex\AppData\Roaming\Thunderbird\Profiles\57d35iy6.default\Mail\pop.goo
> > glemail.com>
> >
> > Basically, the only difference is the directory, with the script working 
> > fine in one but not the other. If I really need to run this script, I can 
> > always copy my Inbox file to the Python directory and run the script, but 
> > it would be great if there were some way to run the script in Thunderbird's 
> > Inbox directory. I suppose I could configure Thunderbird to store the mail 
> > in the Python directory, but that doesn't feel right to me; different stuff 
> > should have its own directory.
> >
> > Figuring that the script might be choking on the crazy-ass long path of the 
> > Thunderbird directory, I created a very simple directory and moved the 
> > Inbox and script to it. With the script edited to:
> >
> > mbox = "C:\thunmail\Inbox"
> >
> > I get this:
> >
> >
> > C:\thunmail>python pcount.py
> > Getting posts...
> >
> > Traceback (most recent call last):
> >    File "pcount.py", line 46, in 
> >      for message in mailbox.mbox(mbox):
> >    File "C:\Python27\lib\mailbox.py", line 784, in __init__
> >      _mboxMMDF.__init__(self, path, factory, create)
> >    File "C:\Python27\lib\mailbox.py", line 550, in __init__
> >      f = open(self._path, 'rb+')
> > IOError: [Errno 22] invalid mode ('rb+') or filename: 
> > 'C:\\thunmail\\\thunmail\\
> > Inbox'
> >
> > C:\thunmail>
> >
> > To the system PATH, I had only added C:\Python27\, so just to be sure, I 
> > also added C:\Python27\lib\, but that didn't fix the problem. For reasons 
> > unknown to me, the script will only work right if the Inbox and script are 
> > in the Python install directory. Any thoughts?
> >
> >
>


Reply via email to