Python Classroom Series – 14/Sept/2021

SQLite Python

  • Inserting and selecting data into/from sqlite database
    • Refer Here for the changeset containing insert and select records from sqlite database
  • Updating and deleting data from sqlite database
    • Refer Here for the changeset containing code to delete or update books

Standard Library

  • The Python standard library consists of modules that are available on all implementations of language i.e. every installation of Python will have access to these modules without need for any further steps
  • Python is oftend described as coming with "batteries included" which is usually a reference to its standard library.
  • Python standard library has lot of modules which we have been using ocassionally so far
    • sqlite3
    • json, csv
  • Knowing how to Navigate in the standard library: Getting to know the standard library is key for any intermediated/advance developer, even if you don’t know how to use all modules
    • Python beginners are usually encourage to take the standard library tour from this tutorial Refer Here

Building command line Applications

  • To build a command line application, we need to have an executable which will take arguments
  • Basic structure:
<executable> <args>
  • Arguments are of two types
    • positional arguments: These arguments are processed according to their position
    cp 1.txt 2.txt
    # 1.txt as per its position is considered as source
    # 2.txt as per its position is considerd as destination
    
    • keyword arguments: These arguments will have a keyword. Keywords will be in longer format (–) and short format (-)
    docker container run --name "test" -p 80:80 nginx
    # we have a keyword argument in long format --name 
    # we have a keyword argument in shorter format -p
    
    docker container run -p 80:80 --name "test"  nginx
    

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin