161k views
1 vote
Use your solution from Programming Assignment 4 (or use your instructor's solution Download instructor's solution) to create a modular Python application. Include a main function (and a top-level scope check), a function that will validate the device is on the network, and a function that prompts for, gets, validates, and returns the ipAddress. New for this assignment: include a validation check to make sure there are no letters in the IP address!

1 Answer

2 votes

Final answer:

To create a modular Python application, you need to create a main function with a top-level scope check, a function to validate the device's network status, and a function to prompt for and validate the IP address. The IP address validation should include a check for letters.

Step-by-step explanation:

In order to create a modular Python application as requested, you can follow these steps:

  1. Create a main function that will serve as the entry point for your program. This function should contain a top-level scope check to ensure that it is being executed directly and not being imported as a module.
  2. Create a function that will validate whether the device is on the network. This function can use various methods to check the network status, such as pinging a known IP address or using a network library to check for active connections.
  3. Create a function that will prompt for, get, validate, and return the IP address. This function should include a validation check to ensure that the IP address does not contain any letters.

User Shoebie
by
8.2k points