Skip to main content

Python Tutorial 6.1 - Standard Library Tour

Welcome to the “Standard Library Tour” tutorial!


Overview

Python ships with a rich set of built-in modules. This lesson highlights a few key ones to explore.

Examples

  • os – Operating system interfaces

    import os
    print(os.getcwd())
    
  • sys – System-specific parameters and functions

    import sys
    print(sys.version)
    
  • math – Mathematical functions

    import math
    print(math.sqrt(16))
    
  • datetime – Date and time manipulation

    from datetime import datetime
    print(datetime.now())
    
  • json – JSON encoding/decoding

    import json
    print(json.dumps({'a':1}))
    

Key Takeaways

  • The standard library saves you time—no installs required.
  • Learn module names and refer to the official docs when in doubt.
  • Learn more about Python's Standard Library here.

Happy exploring!

Comments