python code

Dear friends,
How to generate 2khz sound signal using PC sound card in python.

Something like this, probably


import aud
import time
device = aud.device()
sound = aud.Factory.sine(2000)
device.play(sound)
time.sleep(1)
device.stopAll()