This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script setup> | |
// Doesn't change when route changes | |
const route = useRoute(); | |
// Changes when route changes | |
const path = useRoute().path; | |
// If we need the full route object in a reactive way, we can do this: | |
// | |
// Doesn't change when route changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zipfile | |
def unzip(zip_filename): | |
zip_file = zipfile.ZipFile(zip_filename, 'r') | |
for zipped_file in zip_file.namelist(): | |
zip_file.extract(zipped_file) | |
zip_file.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_collection(collection, tab): | |
if type(collection) == dict: | |
for key in collection: | |
print(f'{tab}"{key}": "{collection[key]}"') | |
if type(collection[key]) in (list, dict): | |
print(tab + '{') | |
print_collection(collection[key], tab + '\t') | |
print(tab + '}') | |
elif type(collection) == list: | |
for item in collection: |