Skip to content

Custom REPL demo is missing utils.py #1486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
WebReflection opened this issue May 24, 2023 Discussed in #1482 · 1 comment
Closed

Custom REPL demo is missing utils.py #1486

WebReflection opened this issue May 24, 2023 Discussed in #1482 · 1 comment
Assignees

Comments

@WebReflection
Copy link
Contributor

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)
`

@WebReflection WebReflection self-assigned this May 24, 2023
@WebReflection WebReflection moved this to Working in PyScript OSS May 24, 2023
@WebReflection
Copy link
Contributor Author

Fixed in #1485

@WebReflection WebReflection moved this from Working to Closed in PyScript OSS May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

No branches or pull requests

1 participant