Skip to content

Custom REPL demo is missing utils.py #1486

Closed
@WebReflection

Description

@WebReflection

Discussed in #1482

Originally posted by pedrokarneiro May 23, 2023

Custom REPL demo is missing utils.py in the 'View code' tab.

Problem:

If you try to copy the solution, a 403 error will come up due to this absence.

Solution:

Add a utils.py to your solution with the following code:

`
from datetime import datetime as dt

def format_date(dt_, fmt="%m/%d/%Y, %H:%M:%S"):
return f"{dt_:{fmt}}"

def now(fmt="%m/%d/%Y, %H:%M:%S"):
return format_date(dt.now(), fmt)

def remove_class(element, class_name):
element.element.classList.remove(class_name)

def add_class(element, class_name):
element.element.classList.add(class_name)
`

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions