Код Python для перехода страниц не работает. Понятия не имею, почемуPython

Программы на Python
Ответить Пред. темаСлед. тема
Anonymous
 Код Python для перехода страниц не работает. Понятия не имею, почему

Сообщение Anonymous »

Контекст: необходимо создать код для проверки размера пакета и прочего.
Проблема: я создал меню для переключения между страницами, и оно не меняется, постоянно повторяя страницу проверки пакета. >

Код: Выделить всё

# Retro Style Turn on Interface For a bit of IBM Style :)

print(":/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\:")
print(":| Program: [MAIL] Monitoring and Inspection of Logistic    V.1|:")
print(":\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/:")

# Login Screen For Addressing User
print("\n\t\t\t「Login」")

# Set A whole lot of variable
username = ''
letter = ''
next_page = ''
page = 0
main_page = 0
check_page = 0
parameter_page = 0
history_page = 0
exit_page = 0

# Use While Loop just in case, User entered nothing
while username == '':
username = input("\nUsername: ")
if username == '':  # Check For Empty
print("Username cannot be empty. Please enter a valid username.")

print("Password: ********") # Password for show only

print("\nWelcome", username)

# Now for the fun of turning on my program
power = input("\nRun Program: MAIL (Y)/(N)")

# Checking For User Input again....
while power != 'Y' and power != 'N':
print("Please enter only 'Y' or 'N'")
power = input("\nRun Program (Y/N): ")
main_page = 1

if power == 'N':
print("Shutting Down Program...")
print("Have a Wonderful Day", username)
main_page = 0

elif power == 'Y':
print("Program Status: Running...")
print("...")
print("\n __________________________________________________________ ")
print("|                                                          |")
print("| Welcome to [MAIL], Monitoring and Inspection of Logistic |")
print("|__________________________________________________________|")
main_page = 1

# The actual menu for my program. FINALLY!
while main_page == 1:
print("\nGood day", username)
print("\npress\tA... Parcel Checking")
print("\tB... Parcel Parameters")
print("\tC... Parcel History")
print("\tD... Shut Down")
letter = input("\nPress any LETTER key.")

# Checking again for User input...
while letter != 'A' and letter != 'B' and letter != 'C':
print("\nPlease enter only the LETTER shown")
print("\npress\tA... Parcel Checking")
print("\tB... Parcel Parameters")
print("\tC... Parcel History")
print("\tD... Shut Down")
letter = input("\nPress any LETTER key.")

# Turn Page on and Off Type
if letter == 'A':
check_page = 1
main_page = 0

elif letter == 'B':
parameter_page = 1
main_page = 0

elif letter == 'C':
history_page = 1
main_page = 0

elif letter == 'D':
exit_page = 1
main_page = 0

# This is the input/checking page
while check_page == 1:
print("\n\t\t\tParcel Checking")
print("Enter the following parameters for checking in (cm)")
length = input("Length> ")
while not length.isdigit() or float(length)  80:
if not length.isdigit():
length = input("False Parameters Detected. Enter LENGTH>")
elif float(length) > 80:
length = input("Parameters Violated. More than 80cm Detected. Enter LENGTH> ")

width = input("Width> ")
while not width.isdigit() or float(width)  80:
if not width.isdigit():
width = input("False Parameters Detected. Enter WIDTH once more.")
elif float(width) > 80:
width = input("Parameters Violated. More than 80cm Detected. Enter WIDTH> ")

height = input("Height> ")
while not height.isdigit() or float(height)  80:
if not height.isdigit():
height = input("False Parameters Detected.  Enter HEIGHT once more.")
elif float(height) > 80:
height = input("Parameters Violated. More than 80cm Detected. Enter HEIGHT> ")

weight = input("Weight> ")
while not weight.isdigit() or float(weight)  10:
height = input("Parameters Violated. More than 10Kg. Detected. Enter HEIGHT> ")

next_package = input("Input Next Package (Y)/(N)")

while next_package != 'Y' and next_package != 'N':
print("Please enter only 'Y' or 'N'")
next_package = input("Input Next Package (Y)/(N)")

if next_package == 'Y':
check_page == 1
main_page == 0

elif next_package == 'N':
check_page == 0
main_page == 1
Я возился с последней частью, думая, что у меня есть код под другими кодами, но либо он повторялся, либо перестал что-либо печатать, как будто в коде произошел разрыв.>

Подробнее здесь: https://stackoverflow.com/questions/792 ... o-clue-why
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Python»