def convert_file(on: online.PNO_online) -> None: file = prompt_for_link(on) notesName = input('Please assign a name to these notes: ') notesName += '.html' print('Creating file...') tList, chapters = on.get_titles_and_chapters(file) on.create_html(notesName, tList, chapters) print('Finished!')
def convert_file(on: online.PNO_online) -> None: file = prompt_for_link(on) notesName = input("Please assign a name to these notes: ") notesName += ".html" print("Creating file...") tList, chapters = on.get_titles_and_chapters(file) on.create_html(notesName, tList, chapters) print("Finished!")
def prompt_for_link(on: online.PNO_online) -> "notes": while True: address = input("Please enter the web address where the notes are located: ") notes = None try: notes = on.open_notes(address) return notes except: print("Can't connect to address, Please enter a valid address")
def prompt_for_link(on: online.PNO_online) -> 'notes': while True: address = input( 'Please enter the web address where the notes are located: ') notes = None try: notes = on.open_notes(address) return notes except: print("Can't connect to address, Please enter a valid address")
def read_file(on: online.PNO_online) -> None: file = prompt_for_link(on) notesName = input('Please assign a name to these notes: ') tList, chapters = on.get_titles_and_chapters(file) while True: table_contents(notesName, tList) selection = input( 'Please choose a chapter you would like to read(Enter a number) or enter b to go back to the main menu: ' ).lower() if selection == 'b': running = quit_program() break try: if int(selection) >= 1 and int(selection) <= len(tList): print_chapter(chapters[int(selection) - 1]) else: print( 'Invalid input! Please try again. Try entering a number to select a chapter or enter b to go back to the main menu' ) except: print( 'Invalid input! Please try again. Try entering a number to select a chapter or enter b to go back to the main menu' )
def read_file(on: online.PNO_online) -> None: file = prompt_for_link(on) notesName = input("Please assign a name to these notes: ") tList, chapters = on.get_titles_and_chapters(file) while True: table_contents(notesName, tList) selection = input( "Please choose a chapter you would like to read(Enter a number) or enter b to go back to the main menu: " ).lower() if selection == "b": running = quit_program() break try: if int(selection) >= 1 and int(selection) <= len(tList): print_chapter(chapters[int(selection) - 1]) else: print( "Invalid input! Please try again. Try entering a number to select a chapter or enter b to go back to the main menu" ) except: print( "Invalid input! Please try again. Try entering a number to select a chapter or enter b to go back to the main menu" )