<commit_before>

#### JSON, Unicode, and File Handling

This is a compressed lesson designed as a jumpstart for working with the open() built-in method, json encoding, unicode encoding, and the json module.


1. ##### Today's deep dive: Opening a file (10 minutes)

    ```bash
    $ echo "hello world" > info.txt
    ```

    ```python
    myfile = 'info.txt'

    with open(myfile) as f:
        contents = f.read()

    print(contents)
    ```

    1. What is going on here? - 3 minutes
        1. First we save the filename as a 'string' variable in python
        2. Next we pass that filename through the open command<commit_msg>Rename variable<commit_after>#### JSON, Unicode, and File Handling

This is a compressed lesson designed as a jumpstart for working with the open() built-in method, json encoding, unicode encoding, and the json module.


1. ##### Today's deep dive: Opening a file (10 minutes)

    ```bash
    $ echo "hello world" > info.txt
    ```

    ```python
    filename = 'info.txt'

    with open(filename) as f:
        contents = f.read()

    print(contents)
    ```

    1. What is going on here? - 3 minutes
        1. First we save the filename as a 'string' variable in python
        2. Next we pass that filename through the open command
{'fraction_non_alphanumeric': 0.0989010989010989, 'fraction_numerical': 0.01098901098901099, 'mean_word_length': 2.7280701754385963, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2544271', 'n_tokens_mistral': 375, 'n_tokens_neox': 348, 'n_words': 168}