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 typing import TYPE_CHECKING, Optional | |
| def import_or_install(package: str, submodule: Optional[str] = None): | |
| try: | |
| if submodule: | |
| module = __import__(f"{package}.{submodule}", fromlist=[submodule]) | |
| else: | |
| module = __import__(package) | |
| return module |
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 subprocess | |
| import sys | |
| import tempfile | |
| from pathlib import Path | |
| try: | |
| ### PERFORM IMPORTS OF NEEDED MODULE IN THIS try: BLOCK | |
| from rich.traceback import install as rtb_install | |
| rtb_install(show_locals=True) |
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 | |
| from pprint import pprint | |
| import subprocess | |
| import sys | |
| def check_python_version(): | |
| v = sys.version_info | |
| if v < (3, 10): | |
| print("This script requires Python 3.10 or higher.") |
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 rich.console import Console | |
| from subprocess import run | |
| import tempfile | |
| import sys | |
| from contextlib import redirect_stdout, redirect_stderr | |
| # If we do not pass file=sys.stdout explicitly, rich output will also be | |
| # captured by the context manager. | |
| console = Console(file=sys.stdout) | |
| console_err = Console(file=sys.stderr, stderr=True) |
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
| #!/usr/bin/env python | |
| import sys | |
| import os | |
| import subprocess | |
| # Script taken from doing the needed operation | |
| # (Filters > Remeshing, Simplification and Reconstruction > | |
| # Quadric Edge Collapse Decimation, with parameters: | |
| # 0.9 percentage reduction (10%), 0.3 Quality threshold (70%) |
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 argparse | |
| import os | |
| import time | |
| import re | |
| import asyncio | |
| from tempfile import TemporaryDirectory | |
| from asyncio import subprocess | |
| from rich import print |
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
| #!/usr/bin/env python3 | |
| import subprocess | |
| import importlib | |
| import platform | |
| import sys | |
| import locale | |
| from rich.console import Console | |
| from rich.table import Table | |
| from rich.panel import Panel |
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 concurrent.futures | |
| import os | |
| import shutil | |
| import subprocess | |
| import time | |
| from concurrent.futures import Future | |
| from dataclasses import dataclass | |
| # Textualize rich dependencies https://github.com/Textualize/rich | |
| from rich.console import RenderableType, Console |
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
| #!/bin/sh | |
| # Execute an underlying | |
| set -eu | |
| prog="$(basename "$0")" | |
| has_command() { command -v 1>/dev/null 2>&1; } | |
| self="$0" | |
| target="$(printf '%s' "$self" | tr '-' '_').py" |
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
| #!/usr/bin/env python3 | |
| # /// script | |
| # dependencies = [ | |
| # "rich", | |
| # "typer", | |
| # ] | |
| # /// | |
| import rich |