<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:'Courier New', courier, monaco, monospace, sans-serif;font-size:12pt"><div>Forwarding to the list....</div><div>Please use ReplyAll when responding.</div><div style="font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt"><br><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><br><div class="gmail_quote">On Wed, Dec 31, 2008 at 4:10 AM, Alan Gauld <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:alan.gauld@btinternet.com" target="_blank" href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex;">
"nathan virgil" &lt;<a rel="nofollow" ymailto="mailto:sdragon1984@gmail.com" target="_blank" href="mailto:sdragon1984@gmail.com">sdragon1984@gmail.com</a>> wrote<div class="Ih2E3d"><br>
<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex;">
Each menu is a function that prints out options, saves a raw_input as the<br>
variable choice, and returns choice. In the main menu, each option leads to<br>
a sub-menu. After choice is defined, however, the sub-menu "tags" the value<br>
of choice.<br>
</blockquote>
<br></div>
Yes that can all work.<div class="Ih2E3d"><br>
<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex;">
Then create a loop of while choice !=q, run current_menu, and include a<br>
bunch of statements along the lines of:<br>
<br>
if choice == &lt;value that leads to first sub-menu>:<br>
       current_menu = &lt;function name for first sub-menu><br>
</blockquote>
<br></div>
Consider using a dictionary keyed by your combined choice values.<br>
Then the big if/elif chain shrinks to<br>
<br>
returnValue = FuncDict[choice](params)<br>
<br>
The only challenge with this route is making all the functions<br>
take a single input argument. But that argument can be a tuple :-)</blockquote><div><br>Dictionaries? Tuples? I just figured out functions, so I'm very new. I'm still working on understanding lists. I know what I have probably isn't the best solution for what I'm trying to do, but I'm trying to work with the little that I know. <br>
</div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex;"><div class="Ih2E3d"><br>
<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex;">
This seems like it would work, but for some reason, every time I run the<br>
code, it freezes after I give input from the main menu. Can anybody help? I<br>
can show my source code, but indentation doesn't seem to copy/paste very<br>
well, so it may be a bit hard to read...<br>
</blockquote>
<br></div>
Try putting it on the pastebin web site and sending us the URL.<br>
That gives us colour coding of syntax too which helps read it!<font color="#888888"></font></blockquote><div><br><br><a rel="nofollow" target="_blank" href="http://pastebin.com/m252eea7a">http://pastebin.com/m252eea7a</a><br><br>It's a simple formula calculator, so the point isn't really the content. I don't have all the formulas coded in yet, but the way I see it, if I can't access the sub-menus that lead to the formulas, then it doesn't do me any good to have the formulas.<br>
</div></div>
</div></div><div style="position:fixed"></div></div></body></html>