[python-win32] Python.AXScript (win32com) in Netstumbler

sam lee skynare at gmail.com
Thu Oct 12 06:20:54 CEST 2006


I am trying to write a Python.AXScript script work with Netstumbler.

http://www.stumbler.net/scripting.html

According to that page, Netstumbler calls functions like, OnScanResult.

I wrote JScript and PerlScript version of OnScanResult and they are
called automatically by Netstumbler.

JScript:
function OnScanResult(SSID,BSSID,CapFlags,Signal,Noise,LastSeen) {
    PlaySound("ns-signal-1.wav");
}

PerlScript:
#!C:/Perl/bin/perl.exe -w
sub OnScanResult {
    my($sid,$mac,$flags,$signal,$noise,$ls) = @_;
    PlaySound('ns-signal-1.wav');
}

PlaySound is what Netstumbler provides for script writers to call.

Above simple scripts work (They play sound whenever Netstumbler scans
for Wifi stuff).

Now, I do the same in Python.AXScript:
def OnScanResult(SSID,BSSID,CapFlags,Signal,Noise,LastSeen):
    PlaySound("ns-signal-1.wav")

And it says PlaySound not defined. Of course there is winsound.PlaySound.
I can use winsound module and it works.
But, the problem is Netstumbler does not provide PlaySound in
Python.AXScript environment as it does to JScript and PerlScript
environment.

Why Python.AXScript so special??

http://starship.python.net/crew/mhammond/win32/PrivacyProblem.html

According to the above link, win32com now comes with two versions of
ActiveScripting environment. And only the one that works with trusted
code.

I think Netstumbler is 'untrusted'. So, win32com.axscript or something
won't work with Netstumbler.

>From the same link: "If a user desires, they may manually register the
version that supports untrusted environments. "

So, I want to register the version that supports untrusted
environments, presumably  like Netstumbler.

I did run win32comext\axscript\client\pyscript_rexec.py and
win32comext\axscript\client\pyscript.py .
But, still no luck.

Question is summed up as: How do I register ActiveScripting engine
that supports untrusted environments?

Or, How do I make Python scripts work with Netstumbler?

Thank you.
Sam.


More information about the Python-win32 mailing list