Is this way of handling a module correct?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 9acca9
    New Member
    • Sep 2022
    • 1

    #1

    Is this way of handling a module correct?

    I made a module to manage the menus of an lcd display.

    The number of options is quite large so I plan to use this file as a module to import into a file that integrates other issues.

    And my question goes this way. For example, when I select to log in to a page in the menu, what I do in the menu is put a variable that when entering that option becomes true.

    So in the main file I have something like:

    Code:
    import menus
    
    ShowMenu = menus.displayMenu(initial_menu)
    ShowMenu.start()
    
    while 1:
        if ShowMenu.login == True:
            makesomething
            ShowMenu.login = False
        if.... etc.
    This is well? I mean, interact in this way with the other module? have a variable in the menus module that help me organize the main flow?
Working...