Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Sound alerts in Jupyter for code completion and exceptions

""" jupyter addin shows starttime, elapsedtime; sounds alert on cell finish
"""
import time
from IPython.core.magics.execution import _format_time
from IPython.display import display as d
from IPython.display import Audio
from IPython.core.display import HTML
import numpy as np
import logging as log

def alert():
    """ makes sound on client using javascript (works with remote server) """      
    framerate = 44100
    duration=.05
    freq=300
    t = np.linspace(0,duration,framerate*duration)
    data = np.sin(2*np.pi*freq*t)
    d(Audio(data,rate=framerate, autoplay=True))
    hide_audio()
Comment

PREVIOUS NEXT
Code Example
Python :: for loop practice problems python 
Python :: get center position of countries geopandas 
Python :: brownie transaction info 
Python :: zipfile python unzip with path 
Python :: replace NaN value in pandas data frame with zeros 
Python :: python list of paths 
Python :: How to append variable in Python 
Python :: expected a list of items but got type int . django 
Python :: WARNING: Ignoring invalid distribution -ip (c:python310libsite-packages) 
Python :: fcn tensorflow 
Python :: pandas datafdrame pyplot 
Python :: shutdown thread python 
Python :: kill os system by pid python script 
Python :: python macro ensurepip py3 
Python :: receive ouput subprocess call 
Python :: image segmentation pyimagesearch 
Python :: #Combine two sets on python with for loop 
Python :: python timestamp human readable 
Python :: xmgrace conditions 
Python :: limiting user input to under 100 characters python 
Python :: "Token" is not defined Pylance 
Python :: variable types in python 
Python :: add label on choropleth map python 
Python :: hmac decrypt python 
Python :: pyjone location 
Python :: how to get current user info in odoo 8 in a controller 
Python :: python webscrapping downloading all the videos in a playlist 
Python :: how to check if a list raises IndexError but wihing a if statement python 
Python :: pandas isolate data lower than a certain percentage 
Python :: fetch member by id discord.py 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =