What is the function of print ('\ a') in python

0

I was told that the print('\a') function of this code produces a beep, but at the time when I run on pycharm there is no beep.

I would like to know what this function is for. And if they could send me a type of print function list, example print('\n') .

#!/usr/bin/python

from datetime import datetime, timedelta

from sys import stdout

from time import sleep

print ('Cronometro regressivo | programador => mmxm')

segundos = int(input('Digite a quantidade de segundos: '))

tempo = timedelta(seconds=segundos)

print ('\n')

while (str(tempo) != '0:00:00'):

    stdout.write("\r%s"%tempo)

    stdout.flush()

    tempo = tempo - timedelta(seconds=1)

    sleep(1)

stdout.write("\r0:00:00")

stdout.flush()

print ('\a')
    
asked by anonymous 30.06.2017 / 01:41

1 answer

0

Use:

print("\a") # Python 3

or

print "\a"  # Python 2

or Bash Shell :

echo $'\a'

Note: In some terminals the campaign may be disabled.

    
30.06.2017 / 03:12