471,321 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,321 software developers and data experts.

Is this way of handling a module correct?

1
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:

Expand|Select|Wrap|Line Numbers
  1. import menus
  2.  
  3. ShowMenu = menus.displayMenu(initial_menu)
  4. ShowMenu.start()
  5.  
  6. while 1:
  7.     if ShowMenu.login == True:
  8.         makesomething
  9.         ShowMenu.login = False
  10.     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?
3 Weeks Ago #1
0 7939

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by N.K | last post: by
9 posts views Thread by Hans-Joachim Widmaier | last post: by
reply views Thread by Dave Cole | last post: by
7 posts views Thread by Spacen Jasset | last post: by
3 posts views Thread by Phillip Ian | last post: by
2 posts views Thread by ===Steve L.=== | last post: by
14 posts views Thread by ccdetail | last post: by
40 posts views Thread by rjcarr | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.