WSC in python clears method arguments

T Malcolm nt_colonel at hotmail.com
Thu Nov 8 10:52:38 EST 2001


I'm calling a WSC written in Python from a VBS script that is task
scheduled.  This WSC is a "friendly" interface to the Python ftp
library.  All is well, except for one quirk.  When I call methods on
the WSC, it will clear the variable I pass as an argument.


Example vbs client script(where objFTP is an instance of the Python
WSC):
----
strRemotePath = rs.Fields("RemotePath").Value

'strRemotePath has a value here

objFTP.cwd(strRemotePath)

'strRemotePath is now a nullstring, the cwd command has succeeded.
----

Python code in WSC (objFTP is an instance of FTP imported from
ftplib):
----
def cwd(RemotePath, FTP=objFTP):
    FTP.cwd(RemotePath)
----

I had to use the FTP=objFTP as an argument because I couldn't
reference objFTP in the function from the "global" namespace where it
resides (another quirk?).

Anyway, does anybody have any idea how I can get this thing to quit
"eating" my variable values?

-- 
Tom



More information about the Python-list mailing list