This file contains 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 asyncio | |
async def read_lines(file_path, lines): | |
with open(file_path, 'r') as file: | |
return [await file.readline() for _ in range(lines)] | |
async def main(): | |
file_path = "jou.txt" | |
lines = [5, 10, 15] | |
tasks = [asyncio.create_task(read_lines(file_path, line)) for line in lines] |
This file contains 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 | |
from flask import Flask, render_template, request, send_file | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
dir_path = os.path.abspath('.') | |
contents = os.listdir('.') | |
files = [] |