queue, double put blocks code



  • I tested this code inside pycom and using the command line generated by pymakr in vs code.

    import queue

    a = queue.Queue()
    a.put("teste")
    print("all good")
    print(a.full())
    a.put("teste")
    print("not gonna show ")

    result:
    all good
    True

    conclusion:
    Is the real limit of the queue one input?
    Or am I doing something wrong?



  • @Doroana, not sure if you have figured this out yet but when you create your instance of the queue, you can give it a parameter of the size of the queue.

    a = queue.Queue(10), this will create a queue with max size 10. The default value is 1.


Log in to reply
 

Pycom on Twitter