You should read the Typer Tutorial - User Guide before referring to this summary. Information icons ℹ️ link to the relevant sections of the Typer Tutorial.
- Documentation: https://typer.tiangolo.com
- Source Code: https://github.com/fastapi/typer
#include <iostream> | |
#include <string> | |
struct color { | |
short r; | |
short g; | |
short b; | |
}; | |
std::string as_24bit_ansi(color values) { |
You should read the Typer Tutorial - User Guide before referring to this summary. Information icons ℹ️ link to the relevant sections of the Typer Tutorial.
from sys import version_info | |
import matplotlib.pyplot as plt | |
import perfplot | |
import pickle | |
import netCDF4 | |
import numpy as np | |
import h5py | |
import tables |
Functions available in this module:
- reflection.(*)_of_type[foo]() // Extract details from type or struct
- reflection.(*)_of(bar) // Extract details from type instance
(*) can be `methods`, `fields` or `attributes`.
Each function returns a map[string]T
where T
can be FunctionData
, FieldData
or StructAttribute
respectively.
#include <stdio.h> | |
#include <stdlib.h> | |
typedef unsigned long u64; | |
/* Start here */ | |
typedef void enc_cfg_t; | |
typedef int enc_cfg2_t; | |
typedef __int128_t dcf_t; |
#!/usr/bin/python3 | |
# Copyright (c) 2022 @Apocryphon (Dante Mendoza Leyva). | |
# All rights reserved. | |
import subprocess | |
import click | |
import pathlib | |
import sys |
Discord is now slowly rolling out the ability to send colored messages within code blocks. It uses the ANSI color codes, so if you've tried to print colored text in your terminal or console with Python or other languages then it will be easy for you.
To be able to send a colored text, you need to use the ansi
language for your code block and provide a prefix of this format before writing your text:
\u001b[{format};{color}m
import random | |
import perfplot | |
lst = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l"] | |
string = "abcdefghijkl" | |
def list_lookup(data): | |
return [lst[n] for n in data] |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
chrome_options = webdriver.ChromeOptions() | |
prefs = {"profile.managed_default_content_settings.images": 2} | |
chrome_options.add_experimental_option("prefs", prefs) | |
driver = webdriver.Chrome(options=chrome_options) | |
driver.get("https://google.com/") |
from subprocess import CREATE_NO_WINDOW | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
from selenium.webdriver.chrome.service import Service | |
service = Service("chromedriver.exe") | |
service.creationflags = CREATE_NO_WINDOW | |
chrome_options = webdriver.ChromeOptions() |