PPL - Assignment No 9
PPL - Assignment No 9
09
Objectives:
Problem Statement:
Outcomes:
Example: This code uses the ‘os' module to get and print the current working directory (CWD) of the
Python script. It retrieves the CWD using the ‘os.getcwd()' and then prints it to the console.
import os
cwd = os.getcwd()
print("Current working directory:", cwd)
import time
print(time.gmtime(0))
Output:
Directory listing, sorted by creation date:
Sun Apr 16 00:07:24 2023 Downloads
Sun Apr 16 00:07:24 2023 Favorites
Sun Apr 16 00:07:24 2023 Links
Sun Apr 16 00:07:24 2023 Music
Sun Apr 16 00:07:24 2023 Pictures
Sun Apr 16 00:07:24 2023 Saved Games
Sun Apr 16 00:07:24 2023 Videos
Sun Apr 16 00:07:24 2023 Documents
Sun Apr 16 00:07:24 2023 My Documents
Sun Apr 16 00:07:24 2023 Desktop
Sun Apr 16 00:07:24 2023 Start Menu
Sun Apr 16 00:07:24 2023 Recent
Sun Apr 16 00:07:24 2023 SendTo
Sun Apr 16 00:07:24 2023 Cookies
Sun Apr 16 00:07:30 2023 Contacts
Sun Apr 16 00:07:30 2023 Searches
Sun Apr 16 00:09:33 2023 OneDrive
Thu Sep 14 09:02:37 2023 .continuum
Thu Sep 14 09:02:45 2023 .conda
Thu Sep 14 09:02:51 2023 .condarc
Thu Sep 14 09:04:47 2023 .ipython
Thu Sep 14 09:05:35 2023 sam_folder.ipynb
Thu Sep 14 09:05:35 2023 .ipynb_checkpoints
Thu Sep 14 15:14:19 2023 Untitled8.ipynb
Wed Sep 20 16:16:45 2023 AppData
Wed Sep 20 16:16:45 2023 Application Data
Wed Sep 20 16:16:45 2023 NTUSER.DAT
Wed Sep 20 16:16:45 2023 NetHood
Wed Sep 20 16:16:45 2023 PrintHood
Wed Sep 20 16:16:45 2023 Templates
Wed Sep 20 16:16:45 2023 Local Settings
Wed Sep 20 16:16:45 2023 NTUSER.DAT{4a7af8e0-57ab-11ee-9d72-e0be037c5d24}.TM.blf
Wed Sep 20 16:16:45 2023 NTUSER.DAT{4a7af8e0-57ab-11ee-9d72-
e0be037c5d24}.TMContainer00000000000000000001.regtrans-ms
Wed Sep 20 16:16:45 2023 ntuser.dat.LOG1
Wed Sep 20 16:16:45 2023 ntuser.dat.LOG2
Mon Oct 9 13:02:02 2023 Untitled.ipynb
Mon Oct 9 13:03:29 2023 Untitled9.ipynb
Fri Oct 13 10:38:14 2023 calc.py
Fri Oct 13 10:40:11 2023 pycache
Fri Oct 13 10:41:12 2023 Untitled10.ipynb
Sat Nov 25 10:20:06 2023 Untitled11.ipynb
Conclusion:
Hence we have learned the Python modules os and time
Assignment Questions: (Write the Answer of following question in Your Assignment book and Get it
checked)
Q. What are the Python modules?