PyZombis fileStructure@6664efd
Social
Runestone in social media:
Follow @iRunestone
Our Facebook Page
Help support us:
Search
Table of Contents
Book Index
User
Assignments
Practice
Change Course
Instructor's Page
Progress Page
Edit Profile
Change Password
Register
Login
Dark Mode
Scratch Activecode
Help
FAQ
Instructors Guide
About Runestone
Report A Problem
3.
Using a messagebox
ΒΆ
from browser import document, alert, window, html def save_data(event): try: destination = destination_input.value description = description_input.value address = address_input.value if not destination or not description or not address: raise ValueError("All fields must be filled") window.sessionStorage["Destination"] = destination window.sessionStorage["Description"] = description window.sessionStorage["Address"] = address except Exception as exception: alert(f'Error: {exception}') app = html.DIV() app <= html.LABEL('Destination: ') destination_input = html.INPUT() app <= destination_input app <= html.LABEL('Description: ') description_input = html.INPUT() app <= description_input app <= html.LABEL('Address: ') address_input = html.INPUT() app <= address_input button = html.BUTTON('Save') button.bind('click', save_data) app <= button document <= app
On a scale from 1 (needs improvement) to 3 (excellent), how would you rate this chapter?
1
2
3
You have attempted
of
activities on this page