Question: Task 0 2 : Understanding the sys Module ( 2 0 points ) Write a Python script that uses the sys module to perform the

Task 02: Understanding the sys Module (20 points)
Write a Python script that uses the sys module to perform the following tasks:
In a main method:
a. Read and print the command-line arguments when the script is run.
b. Print the Python path (the directories where Python is looking for modules to
import).
c. Print the Python version.
d. Print the platform name.
The main() function must only run automatically if the module is being run directly, not
when imported.
Here is a screenshot of the expected behavior, testing all scenarios described above. Replicate
this functionality in your script, including the formatting and outputs of all messages. The
program must work for any arguments that the user provides after the name of the script.Command-line arguments:
./lab_h_task_02_sdevil.py
system
programming
in
Python
is
a
hoot!
Python path:
/home/eric/lab h
/usr/lib/python310.zip
/usr/lib/python3.10
/usr/lib/python3.10/lib-dynload
/usr/local/lib/python3.10/dist-packages
/usr/lib/python3/dist-packages
Python version: 3.10.6(main, May 292023,11:10:38)[GCC 11.3.0]
Platform name: linux
 Task 02: Understanding the sys Module (20 points) Write a Python

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!