M03 - Dependencies, Modules, Packages Flashcards
import syntax & syntax w/ alias
import module_name
import module_name as mn
Order of how code reads
Module ->
Classes/Functions/Variables ->
Methods used for functions and classes
Datetime module example of how code reads (nesting doll description)
Ex: datetime.datetime.now( ) #w/ alias: dt.datetime.now( ) 1. Module: datetime -> 2. datetime Classes: date, datetime, time, timedelta, timezone -> 3. datetime Methods day, hour, microsecond, minute, month, now, second, time, today, utcnow, weekday, year
Packages
- Folders that contain a set of Python modules
- May contain various subpackages (or other folders)
- Imported with the import statement
Dependencies
-Modules and packages, or a programming script that someone else has written, that allows you to increase the functional programming of your code, or speed and efficiency
Modules
-Separate software component
-Usually Python files w/ .py extension
-Name of the module will be the name of the file
-Can have the following defined and implemented:
+Functions
+Classes
+Variables
CSV Module syntax
Sytnax to see all functions available in CSV
import csv
dir(csv)