Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
how to implement a queue-like container with sort function
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Gregory Ewing, post: 5129607"] You can use a list as a queue. If you have a list l, then l.append(x) will add an item to the end, and l.pop(0) will remove the first item and return it. Then you just need to check the length of the list before adding an item, and if it's full, do something to process the items first. You can encapsulate all this inside a class if you want, but that's optional. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
how to implement a queue-like container with sort function
Top