Skip to content

Adding a clear_cell_output command? #53

@jondufault

Description

@jondufault

I adore this package. I was wondering if there's a proper way to clear the output of a cell while it's running. I'm doing some tuning/calibration for a sensor and want the output on a cell to print out realtime values for the sensor (overwriting the value)

Currently I'm using this hack by modifying kernel.py and having my code do print("CLEAR_OUTPUT") and then print(sensor_val)

    def sres(self, output, asciigraphicscode=None, n04count=0, clear_output=False):
        if "CLEAR_OUTPUT" in output:
            output = None
            clear_output = True

I'm new to micropython so I don't know if there's some function I'm missing that's obvious and new to this package too. I tried from upysh import clear and using that but it didn't do anything. Trying to get up to speed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions