ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-win32
python-win32
Re: [python-win32] [OT] importing win32com.shell - RESOLVED
by Reed L. O'Brien other posts by this author
Feb 22 2006 2:14PM messages near this date
[python-win32] importing win32com.shell | [python-win32] Re: Pywin32 way of getting to open files
Reed L. O'Brien wrote:
>  Hello:
>  
>  I wrote a quickie script to get word and charatcer counts from word
>  documents using Tim Golden's winshell module.
>  
>  When I py2exe it it doesn't pull in shell from win32com.shell, since it
>  appears, to me, to be in win32comext instead of win32com. Is there a
>  standard way to deal with this or do I need to go name it manually in my
>  py2exe setup file (which I tried while running out the door yesterday
>  without sucess)?
>  
>  Thanks,
>  ~reed
>  
>  

Answering my own question for the record:
Sorry for the OT post in the first place.

Because of some magic that the win32 wizards cast, py2exe doesn't find
win32com.shell.

import sys

try:
    import modulefinder
    import win32com
    for p in win32com.__path__[1:]:
        modulefinder.AddPackagePath("win32com", p)
    for extra in ["win32com.shell","win32com.mapi"]:
        __import__(extra)
        m = sys.modules[extra]
        for p in m.__path__[1:]:
            modulefinder.AddPackagePath(extra, p)
except ImportError:
    # no build path setup, no worries.
    pass

The answer was here:
http://starship.python.net/crew/theller/moin.cgi/WinShell

Best regards and thanks to all who make python such a great language...
~reed

-- 
4.6692916090
'cmVlZEBpbnRlcnNpZWdlLmNvbQ==\n'.decode('base64')
http://www.spreadfirefox.com/?q=affiliates&id=16474&t=1
keyID: 0x0FA09FCE
_______________________________________________
Python-win32 mailing list
Python-win32@[...].org
http://mail.python.org/mailman/listinfo/python-win32
Thread:
Reed L. O'Brien
Reed L. O'Brien

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved