Skip to main content
Ctrl+K

evdspy documentation

Contents:

  • Introduction
  • Api Key Configuration
  • get_series Function
  • get_series_exp Function
  • setup Function
  • save Function
  • menu Function
  • Proxy Configuration
  • Examples
  • .rst

menu Function

Contents

  • menu()
  • Function Details
    • menu()
  • Parameters
  • Returns
  • Raises
  • Example Usage

menu Function#

The menu function displays a list of selectable options to the user and returns the index of the chosen option. This function is useful in CLI applications where user interaction is required to choose between different actions.

evdspy.menu()[source]#

Displays user-friendly menu screen for many functionalities such as saving API key, getting data, categories etc. :return: None

Function Details#

evdspy.menu()[source]#

Displays user-friendly menu screen for many functionalities such as saving API key, getting data, categories etc. :return: None

Parameters#

optionslist of str

A list of strings that represent the choices available to the user.

Returns#

int

The index of the option selected by the user, where the first option is indexed as 0.

Raises#

ValueError

If the user’s input is not a valid option index.

Example Usage#

Here is a simple usage example that demonstrates how to use the menu function:

from evdspy import menu
menu()

This example will display a menu with three options. After the user selects an option, the function will print the selected option.

previous

save Function

next

Proxy Configuration

Contents
  • menu()
  • Function Details
    • menu()
  • Parameters
  • Returns
  • Raises
  • Example Usage

By Sermet Pekin

© Copyright 2024, Sermet Pekin.