I do not know where this Queue
class is coming from, but if it's from Python itself, from queue
module, there are many errors in your program. But considering that it is a proper implementation and that all methods used exist, ready the errors:
Your condition to run main
is wrong. The correct one is:
if __name__ == "__main__":
main()
It does not make sense to read the option before displaying the possibilities and if it is to be compared with integer values, it is necessary to convert it to integer.
print ("1. Imprimir uma fila (sem destruí-la)")
print ("2. Copiar uma fila para outra")
print ("3. Verificar se duas filas são iguais")
print ("4. Remover um elemento da fila, conservando o restante da fila.")
print ("0. Para SAIR")
x = int(input("Digite uma opção: "))
Your indentation problem is in elif
which does not execute any code. Python does not allow this. If you want to implement the logic later, but still maintain the conditions, use the pass
directive.
if (x == 1):
q.imprime()
elif (x == 2):
pass
elif (x == 3):
pass
elif (x == 4):
pass
elif (x == 0):
print ("SAIU...")
break
else:
print("ERRO! ")