-
Variables & Types
- Python: Dynamically typed.
x = 5 - TypeScript: Statically typed.
let x: number = 5;
- Python: Dynamically typed.
-
Strings
-
Python:
x = "Hello"
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 shutil, os | |
| def kaggle_export(output_dir, zip_name): | |
| """Create a zip file and export your work in the kaggle working directory. | |
| Args: | |
| output_dir (str): The path to the directory to be zipped. | |
| zip_name (str): The name of the zip file to be created. | |
| Returns: |
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
| """ | |
| This script, which converts ui elements in json to yolo txt format, was written in line with the need for the project | |
| I was working on. Possible to make improvements on performance. | |
| """ | |
| import os | |
| import shutil | |
| import json | |
| #bounds => [left, top, right, bottom] |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>First Flask Web App</title> | |
| </head> | |
| <body> | |
| <h2>Congratulations! You made your first flask web application!</h2> | |
| </body> | |
| </html> |
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, render_template | |
| app = Flask(__name__) #imports name of the place the app is defined | |
| @app.route('/') #the route that we want to access | |
| def home(): #the function for the given route | |
| return render_template('index.html') #generates output from index.html file | |
| if __name__ == '__main__': | |
| app.run() |