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 os | |
def main(my_path: str, replace_name: str): | |
for dirpath, dirnames, filenames in os.walk(my_path): | |
for dirname in dirnames: | |
dir_old_name = os.path.join(dirpath, dirname) | |
if dir_old_name.find(replace_name) != -1: |
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
from flask import Flask | |
from flask_caching import Cache | |
import random | |
app = Flask(__name__) | |
cache = Cache(app, config={'CACHE_TYPE': 'redis', 'CACHE_REDIS_URL': 'redis://localhost:6379/0'}) | |
@app.route("/route1") | |
@cache.cached(timeout=10) | |
def route1(): |