help with a com object

Alex Martelli aleaxit at yahoo.com
Wed Aug 30 17:31:11 EDT 2000


"Scott Hathaway" <slhath at home.com.nospam> wrote in message
news:8G9r5.1195$qO1.72033 at news.flash.net...
> After trying the following (per the suggestions I have gotten) I get the
> same error.
    [snip]
> Please help!

I've run your code, exactly, and then the following VBScript script
(on my Win98 box here at home):

WScript.Echo "start"
set x=CreateObject("PythonDir.Utils")
WScript.Echo "created"
call x.GetListing("c:/","f")
WScript.Echo "done"

Resulting output:

D:\Python16\CXX-5.0b\Demo>cscript pa.vbs
Microsoft (R) Windows Script Host Version 5.1 for Windows
Copyright (C) Microsoft Corporation 1996-1999. All rights reserved.

start
created
SUHDLOG.BAK| AUTOEXEC.DOS| DETLOG.TXT| SUHDLOG.DAT| DETLOG.OLD| MSDOS.SYS|
BOOTL
OG.TXT| BOOTLOG.PRV| MSDOS.---| SETUPLOG.OLD| NETLOG.TXT| SUHDLOG.---|
SCANDISK.
LOG| CONFIG.SYS| AUTOEXEC.BAK| AUTOEXEC.VIA| atimpp.log| upgrade.txt|
testfile.t
xt| pippo.vbs| IO.SYS| SETUPLOG.TXT| SETUPXLG.TXT| AUTOEXEC.002|
ffastun.ffl| ff
astun0.ffx| ffastun.ffo| ffastun.ffa| ASD.LOG| tubbl_all.zip| wxtry.py|
CONFIG.D
OS| AutoExec.bat| .bash_history| lib.dat| MSHTML.IDL| cas.csv| prova.txt|
Rescue
d Document.txt| COMMAND.PIF| hi.doc| ~$hi.doc| COMMAND.COM| MSDOS.BAK|
SYSTEM.1S
T| aut.zip| pippo.xml| pip.xml| pirip.xml| index.htm| index_tiscali.htm|
.ptkeds
n| APInstall.log| Autoexec.001| pippo.txt| 6s.txt| ks.txt|
python_grimoire.txt|
WINDOWSWinHlp32.BMK| SVGView.exe| NewMacros.bas| pippo.htm| vai.vbs|
witha.txt|
withouta.txt| pip.txt| a.htm| sitecustomize.py|done

D:\Python16\CXX-5.0b\Demo>

I.e., no errors at all, but rather exactly what was expected.
(Yeah, I've got a C:\ full of junk -- that's where I end up
storing a throwaway file, by habit, when I can't think of a
specific/appropriate place:-).


Now, if this COM object can be accessed via VBScript, but not
via PHP (that is the COM-driving language you were trying to
use, right?), would you think the problems are with the COM
object, or perhaps rather with your COM-driving attempts...?


I suggest you try this VBScript (or some equivalently simple
COM-driving code for whatever scripting language you prefer
and fully master).  If it works, while the attempts to use PHP
keep not working, then it seems PHP may be the problem...


Alex






More information about the Python-list mailing list