0

it's me again! xD I was wondering around some forums trying to find an answer to yesterday's question... And well i added the LAST 4 LINES OF CODE code to mine and i realised it kinda worked, the only thing i have to change now is the "break" property, i would like the code to start from the beginning once the user enters "y" What can i enter for this to work?

import time
print("Booting System (Alfa V1.2, Bugs Fixed, Loop added)")
time.sleep(1)
print("Hello, and welcome to Training OS")
time.sleep(2)
print("What would you like to do ?")
time.sleep(1)
txt = raw_input("1.File Explorer  2.System Info.  ( 1 or 2 )")
if txt=="1": 
    print("Loading File Explorer") 
    time.sleep(1)
    print("  _____    _____ \n /     |  /     | \n |     |  |     | \n |_____|  |_____| \n  File1    File2  ")
    time.sleep(0.5)
    file = raw_input("1.File1 2.File2 ( 1 or 2 )")
    if file=="1":
        print("\n\nFile1:"
              "\n_______________________________________"
              "\nTOP SECRET UPDATE INFO:"
              "\n           Update Name . . . . 1.2"
              "\nEstimated Release Date . . . . 25.09.21"
              "\n(Official release date:. . . . 24.09.21)"
              "\n          New Features . . . . Loop"
              "\n_______________________________________")
    else:
        print("\n\nFile2:"
              "\n----------------------------------------"
              "\n                                        "
              "\n              Error 404.                "
              "\n             File Missing               "
              "\n                                        "
              "\n----------------------------------------")
else:
    print("\n\nSystem Info:"
          "\n--------------------------------------------------------------------------------------"
          "\n\nOs version: . . . . . 1.1 (New features: File Explorer)"
          "\n   Founded: . . . . . 22.09.2021, Baku, Azerbaijan"
          "\n  Products: . . . . . TOS"
          "\n\n***This OS is still being developed so some features are currently unaviable :(***"
          "\n--------------------------------------------------------------------------------------")

while True:
    cmd = raw_input('\nAnything else? Enter \'y\'n')
    if cmd == 'y':
        break
import time
print("Booting System (Alfa V1.2, Bugs Fixed, Loop added)")
time.sleep(1)
print("Hello, and welcome to Training OS")
time.sleep(2)
print("What would you like to do ?")
time.sleep(1)
txt = raw_input("1.File Explorer  2.System Info.  ( 1 or 2 )")
if txt=="1": 
    print("Loading File Explorer") 
    time.sleep(1)
    print("  _____    _____ \n /     |  /     | \n |     |  |     | \n |_____|  |_____| \n  File1    File2  ")
    time.sleep(0.5)
    file = raw_input("1.File1 2.File2 ( 1 or 2 )")
    if file=="1":
        print("\n\nFile1:"
              "\n_______________________________________"
              "\nTOP SECRET UPDATE INFO:"
              "\n           Update Name . . . . 1.2"
              "\nEstimated Release Date . . . . 25.09.21"
              "\n(Official release date:. . . . 24.09.21)"
              "\n          New Features . . . . Loop"
              "\n_______________________________________")
    else:
        print("\n\nFile2:"
              "\n----------------------------------------"
              "\n                                        "
              "\n              Error 404.                "
              "\n             File Missing               "
              "\n                                        "
              "\n----------------------------------------")
else:
    print("\n\nSystem Info:"
          "\n--------------------------------------------------------------------------------------"
          "\n\nOs version: . . . . . 1.1 (New features: File Explorer)"
          "\n   Founded: . . . . . 22.09.2021, Baku, Azerbaijan"
          "\n  Products: . . . . . TOS"
          "\n\n***This OS is still being developed so some features are currently unaviable :(***"
          "\n--------------------------------------------------------------------------------------")
import time
print("Booting System (Alfa V1.2, Bugs Fixed, Loop added)")
time.sleep(1)
print("Hello, and welcome to Training OS")
time.sleep(2)
print("What would you like to do ?")
time.sleep(1)
txt = raw_input("1.File Explorer  2.System Info.  ( 1 or 2 )")
if txt=="1": 
    print("Loading File Explorer") 
    time.sleep(1)
    print("  _____    _____ \n /     |  /     | \n |     |  |     | \n |_____|  |_____| \n  File1    File2  ")
    time.sleep(0.5)
    file = raw_input("1.File1 2.File2 ( 1 or 2 )")
    if file=="1":
        print("\n\nFile1:"
              "\n_______________________________________"
              "\nTOP SECRET UPDATE INFO:"
              "\n           Update Name . . . . 1.2"
              "\nEstimated Release Date . . . . 25.09.21"
              "\n(Official release date:. . . . 24.09.21)"
              "\n          New Features . . . . Loop"
              "\n_______________________________________")
    else:
        print("\n\nFile2:"
              "\n----------------------------------------"
              "\n                                        "
              "\n              Error 404.                "
              "\n             File Missing               "
              "\n                                        "
              "\n----------------------------------------")
else:
    print("\n\nSystem Info:"
          "\n--------------------------------------------------------------------------------------"
          "\n\nOs version: . . . . . 1.1 (New features: File Explorer)"
          "\n   Founded: . . . . . 22.09.2021, Baku, Azerbaijan"
          "\n  Products: . . . . . TOS"
          "\n\n***This OS is still being developed so some features are currently unaviable :(***"
          "\n--------------------------------------------------------------------------------------")

while True:
    cmd = raw_input('\nAnything else? Enter \'y\'n')
    if cmd == 'y':
        break

These four lines /\

  • Put it all in a while loop. At the end of the program add an if statement, if the user inputs “restart” continue the loop, if input != “restart” break the loop. I’m on my phone so I can’t formulate it better, good luck! – realFishSam Sep 24 '21 at 17:01
  • @Samuel Thanks a lot, i won't be able to do it by myself but thanks for explaining :) – The spAce Company Sep 24 '21 at 17:03
  • 1
    Friendly notes: "it's me again! xD [...] yesterday's question [...] What can i enter for this to work?" 1) SO user list has [420k pages](https://stackoverflow.com/users?page=424183) and [python] has 50+/hour questions, so a chance somebody will remember and link the questions is quite a small one. Please use **links** between your questions if you want to show the relationship between them. Example: `[old question](https://...)` 2) Always duplicate the code and trim it to the smallest example you can produce for the behavior you need. It's simpler. 3) Show what you've tried and describe it. :) – Peter Badida Sep 24 '21 at 17:34
  • @ThespAceCompany also, I was bored, so I created a sample for this problem to my private collection and submitted it as [an answer here](https://stackoverflow.com/a/69319924/5994041). Feel free to study or utilize however you want. – Peter Badida Sep 24 '21 at 18:58

0 Answers0