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

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

Сообщение Anonymous »

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

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

# Set A whole lot of variable
letter = ''
next_page = ''
main_page = 1
check_page = 0
history_page = 0

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

print("\n __________________________________________________________ ")
print("|                                                          |")
print("| Welcome to [MAIL], Monitoring and Inspection of Logistic |")
print("|__________________________________________________________|")

# Menu for Program
while main_page == 1:
print("\nGood day")
print("\npress\tA... Parcel Checking")
print("\tB... Parcel History")
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 History")
letter = input("\nPress any LETTER key.")

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

if letter == 'B':
history_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 == '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»