Listing the Resources Defined in a Package or Module Scenario You are implementing a program at work and you need to use a package that you have never interacted with before. You find that you need to write a script using the directory method to list all resources that are available in that package. Aim Use a function which will take a package or module name and print out the names of all the resources defined in the package or module using the directory method. Steps for Completion 1. Define a function called resources_scanner that takes an argument package. 2. Using the dir method create a variable to list all the resources that are available in that package. 3. Inside the function, use a for statement to print and list each of the package's resources. Run your script using the python3 main.py command in the terminal or by importing and calling your method in the interactive python shell. The output should be as shown in Snippet 8.37:
Listing the Resources Defined in a Package or Module Scenario You are implementing a program at work and you need to use a package that you have never interacted with before. You find that you need to write a script using the directory method to list all resources that are available in that package. Aim Use a function which will take a package or module name and print out the names of all the resources defined in the package or module using the directory method. Steps for Completion 1. Define a function called resources_scanner that takes an argument package. 2. Using the dir method create a variable to list all the resources that are available in that package. 3. Inside the function, use a for statement to print and list each of the package's resources. Run your script using the python3 main.py command in the terminal or by importing and calling your method in the interactive python shell. The output should be as shown in Snippet 8.37:
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question

Transcribed Image Text:>>> resources_scanner(string)
Formatter
Template
_ChainMap
_TemplateMetaclass
__all___
__builtins___
__cached__
__doc__
__file__
__loader___
__name__
__package__
__spec__
_re
_string
ascii_letters
ascii_lowercase
ascii_uppercase
capwords
digits
hexdigits
octdigits
printable
punctuation
whitespace
Snippet 8.37

Transcribed Image Text:Listing the Resources Defined in a
Package or Module
Scenario
You are implementing a program at work and you need to
use a package that you have never interacted with
before. You find that you need to write a script using the
directory method to list all resources that are available in
that package.
Aim
Use a function which will take a package or module name
and print out the names of all the resources defined in
the package or module using the directory method.
Steps for Completion
1. Define a function called resources_scanner that
takes an argument package.
2. Using the dir method create a variable to list all the
resources that are available in that package.
3. Inside the function, use a for statement to print and
list each of the package's resources.
Run your script using the python3 main.py command in
the terminal or by importing and calling your method in
the interactive python shell. The output should be as
shown in Snippet 8.37:
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY