Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 916 Bytes

resources.md

File metadata and controls

24 lines (19 loc) · 916 Bytes

Final Project resources

Seee also: open-ended assignment information

Counting lines of code

To count the number of lines of code in a notebook:

{% if id == "nyu" -%}

  1. Download the notebook.

  2. Upload the notebook to Google Colab. {%- endif %}

  3. Download the notebook as a Python file.

    1. With the notebook open in {{coding_env_name}}, go to File->Download->Download .py.
  4. Upload the Python file to Google Colab{% if id == "columbia" %} (directly, not to Google Drive){% endif %}.

    1. Click the Files icon in the sidebar.
    2. Click the Upload to session storage button.
    3. Select the .py file.
  5. Put the following in a code cell and run it.

    !apt-get install -y cloc > /dev/null
    !cloc --hide-rate --by-file *.py