im new to python. just started today. learned a few things but not much.
I have made 4 different menus each with a list of choices that executes certain functions. i want to make a 4 choice menu that can direct me to each one of the other 4 menus.

ex.

B Find Boyles Gas Law
C Find Charle's Gas Law
... etc

then i choose B and it goes to

iv Find initial volume
ip Find initial Pressure
...etc.

i have a menu for each law made separate but i need to figure out how to combine them


here is the code for my Boyle's Gas Law.pyw

# This program runs Boyle's Gas law Formula
def print_options():
    print "Options:"
    print " 'p' print options"
    print " 'iv' Find initial volume"
    print " 'ip' Find initial pressure"
    print " 'fv' Find final volume"
    print " 'fp' Find final pressure"
    print " 'q' quit the program"

choice = "p"
while choice != "q":
        if choice == "fv":
                print "Finds final volume in BOYLE'S GAS LAW FORMULA => P1V1=P2V2"
                p1 = input("Pressure 1: ")
                p2 = input("Pressure 2: ")
                v1 = input("Volume 1: ")
                print "Final Volume=", (p1 * v1) / p2
        elif choice == "fp":
                print "Finds final pressure in BOYLE'S GAS LAW FORMULA => P1V1=P2V2"
                p1 = input("Pressure 1: ")
                v1 = input("Volume 1: ")
                v2 = input("Volume 2: ")
                print "Final Pressure=", (p1 * v1) / v2
        elif choice == "iv":
                print "Finds initial volume in BOYLE'S GAS LAW FORMULA => P1V1=P2V2"
                p1 = input("Pressure 1: ")
                p2 = input("Pressure 2: ")
                v2 = input("Volume 2: ")
                print "Initial Volume=", (p2 * v2) / p1
        elif choice == "ip":
                print "Finds initial pressure in BOYLE'S GAS LAW FORMULA => P1V1=P2V2"
                p2 = input("Pressure 2: ")
                v1 = input("Volume 1: ")
                v2 = input("Volume 2: ")
                print "Initial Pressure=", (p2 * v2) / v1
        elif choice != "q":
                print_options()
        choice = raw_input("option: ")

I'm not quite understanding the problem here,
you have boyle's, charles's, and etc. calculators
all written out
but you want to combine them so that you can access
then all from a single top menu?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.