Python Pyperclip

Problems installing pyperclip module for python.  Not recognised as a module. 

Not able to install it from command line.  Resolved by running pip install pyperclip by running command line as administrator.  (Right-click on command line icon in start menu and select "run as administrator").


Remember this about joins in SQL...

You may be confused by the differences between joins in SQL.

A standard JOIN or inner-join in SQL will join tables where the rows are exactly matching on the column that you are joining on.  It will automatically not include non-matching rows, so that you are only presented with rows that are consistent.  The benefit of this is that you are only presented with consistent and accurate information.   The disadvantage is that you are missing information from some items.

However, a LEFT JOIN will join tables on a column where rows may not be matching (inconsistency between tables can be caused by one table being updated, but corresponding information in another table not being updated). In this scenario, you are given all information, but some attributes may be listed as NULL.
Animation of a Left Join
Image above from codecademy.com
https://s3.amazonaws.com/codecademy-content/courses/learn-sql/multiple-tables/left-join.gif

A CROSS JOIN creates a Cartesian Product.  This means that it will allow us to combine all rows of one table with all rows of another table. If there are three rows in table A, and three rows in table B, all three rows of table A will be joined with all three rows of table B.  The results of this join will have 9 rows.



Shebang Line

The Shebang Line should be the first line of your python program. 

This is what Automate the Boring Stuff with Python author Al Sweigart says about the Shebang line.

The first line of all your Python programs should be a shebang line, which tells your computer that you want Python to execute this program. The shebang line begins with #!, but the rest depends on your operating system.
  • On Windows, the shebang line is #! python3.
  • On OS X, the shebang line is #! /usr/bin/env python3.
  • On Linux, the shebang line is #! /usr/bin/python3.
You will be able to run Python scripts from IDLE without the shebang line, but the line is needed to run them from the command line.

SQLite strftime() Function

Did you know that strftime() is an SQLite function than allows the programmer to return a formatted date. 

It takes two arguments: 

strftime(format, column)

  • To get an hour: strftime('%H', column_name)

  • To get the year: strftime('%Y', column_name)

  • To get the month: strftime('%m', column_name)

  • To get the day: strftime('%d', column_name)

  • To get the minute: strftime('%m', column_name)

  • To get the second: strftime('%S', column_name)

The above is true as long as the time format is YYYY-MM-DD HH:MM:SS

More on this function can be read from the SQL documentation here.

Web Development: Organizing Files and Folders

When you begin to build your website, it's a very clever idea to organize  your files and folders efficiently. You should have: A ...