Thorn wrote:It's the "winsound" library.
Google "Python playsound" and "Python playsound winsound", and you hsould find plenty of references.
Thanks!!!
Now, I can do stuff like:
- Code: Select all
import winsound
import easygui
easygui.msgbox('lol')
winsound.PlaySound("ns-signal-1.wav", winsound.SND_FILENAME)
easygui is from :
http://ferg.org/easygui/ (simple Tkinter routines)
If I run above, it displays a message box and when I close it, it plays sound (easygui.msgbox probably has a loop).
So far so good.
Now, I want to try OnScalResult:
First, using JScript:
- Code: Select all
function OnScanResult(SSID,BSSID,CapFlags,Signal,Noise,LastSeen) {
PlaySound("ns-signal-1.wav")]
If I run above, it plays periodic sound, whenever scan is done.
Now, onto Python:
[code]
import winsound
def OnScanResult(SSID,BSSID,CapFlags,Signal,Noise,LastSeen):
winsound.PlaySound("ns-signal-1.wav", winsound.SND_FILENAME)
[/code]
Now, the script doesn't even run (when I click Apply, it shows Not Running).
Do I have to put OnScanResult to some specific module??
I don't know why JScript version works but not Python version...
Ok, to make Python version really identical to JScript version, I did:
[code]
import winsound
def PlaySound(name):
winsound.PlaySound(name, winsound.SND_FILENAME)
def OnScanResult(SSID,BSSID,CapFlags,Signal,Noise,LastSeen):
PlaySound("ns-signal-1.wav")
Still, NetStumbler doesn't seem to call OnScanResult...
Help.
Thanks.
-edit
Better yet, if there is a documentation that describes how netstumbler calls those functions..etc will be awesome!!!!!!