Question: Task 0 2 : Understanding the sys Module ( 2 0 points ) Write a Python script that uses the sys module to perform the
Task : Understanding the sys Module points
Write a Python script that uses the sys module to perform the following tasks:
In a main method:
a Read and print the commandline 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.Commandline arguments:
labhtasksdevil.py
system
programming
in
Python
is
a
hoot!
Python path:
homeericlab h
usrlibpythonzip
usrlibpython
usrlibpythonlibdynload
usrlocallibpythondistpackages
usrlibpythondistpackages
Python version: main May ::GCC
Platform name: linux
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
