Socket
Socket
Sign inDemoInstall

queuepy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

queuepy

Simple module to create queues


Maintainers
1
PyQueue
A simple module lib to queue your lists!

Usage:

# List: The list you are going to transform into a queue
# Length: The maximum size of the queue
# Input: The input from the user (can be a input('')) or an str

Queue(list, length, input)
# Returns the simple queue

Queue(list, length, input).input()
# Returns the element that was added

Queue(list, length, input).output()
# Returns the element that was removed

Queue(list, length, input).infos() # or .info()
# Returns the queue, the input and the output of the queue.

How it works

  • Insert the wanted string onto the list if the maximum size of the list is less than the wanted size.
  • If the size of the list is greater than the wanted size, pop out the last queue element and insert the wanted string.

TODO:

  • Add .create() function
    • will create 2 buffers for temporary usage.
    • e.g: Queue(q, 3, in).create(1)
      • creates a new buffer inside the Queue class itself
      • can use .input(), .output() and .infos()
      • cannot be referenced outside the Queue class.
  • Double-Reference return Methods
    • allows the user to reference Queue without needing to print() it.
      • also allows the user to reference Queue with print().

graph TD
    A[Read the input] -->|Verify if the size is less than the wanted|B(Insert string on the first position)
    B --> C{Check the queue}
    C -->|If the size is less|D[Insert at 0 and move the rest]
    C -->|If size is greater|E[Insert at 0 and pop the last]
    E --> F
    D --> F
    F{Rest of args}
    F --> |.input|H(print the new element)
    F --> |.output|G(print the removed element)
    F --> |info / infos|I(print the queue, the input and the output)

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc