Fix Python – Play audio with Python

How can I play audio (it would be like a 1 second sound) from a Python script?
It would be best if it was platform independent, but firstly it needs to work on a Mac.
I know I could just execute the afplay file.mp3 command from within Python, but is it possible to do it in raw Python? I would also be better if it didn’t rely on external libraries…..

Fix Python – Python: Making a beep noise

I’m trying to get the program to give me a beeping noise. I’m on a windows machine. I’ve looked at
But not sure how I can program this with a barcode scanner.
Here is my code for the serial barcode scanner.
ser = serial.Serial()
ser.baudrate = 9600

#for windows
ser.port = 2 #for COM3

Fix Python – Sound alarm when code finishes

I am in a situation where my code takes extremely long to run and I don’t want to be staring at it all the time but want to know when it is done.
How can I make the (Python) code sort of sound an “alarm” when it is done? I was contemplating making it play a .wav file when it reaches the end of the code…
Is this even a feasible idea?
If so, how….