Skip to content

Instantly share code, notes, and snippets.

@promto-c
promto-c / dpx.py
Last active October 5, 2023 19:40 — forked from jackdoerner/dpx.py
Read Metadata and Image data from 10-bit DPX files in Python 3
"""
dpx.py
Read Metadata and Image data from 10-bit DPX files in Python 3
Copyright (c) 2016 Jack Doerner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@promto-c
promto-c / CHANGELOG.md
Created October 9, 2023 14:55
Changelog Template (CHANGELOG.md) for User-Facing and Developer-Focused Changes

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Note:

  • Release Notes: Intended for end-users.
  • Internal Changes: Intended for developers working on this project.
@promto-c
promto-c / line_profiler_guide.md
Created October 11, 2023 19:49
Quick Guide to Using `line_profiler` for Python Performance Analysis

line_profiler offers a detailed, line-by-line breakdown of execution time for specific functions in your Python code. Here's how to use it:

1. Installation

pip install line_profiler

2. Marking Functions for Profiling

Mark the functions you wish to profile with the @profile decorator. This acts as a placeholder for kernprof, the utility used to execute and generate profiling data.

@promto-c
promto-c / memory_profiler_guide.md
Created October 11, 2023 20:23
Quick Guide to Using `memory_profiler` for Python Memory Consumption Analysis

memory_profiler provides a detailed, line-by-line breakdown of memory consumption for specific functions in your Python code. Here's how to harness its capabilities:

1. Installation

pip install memory-profiler

2. Marking Functions for Profiling

Mark the functions you wish to profile with the @profile decorator, similar to line_profiler.

@promto-c
promto-c / freezable_tree_widget.py
Last active October 16, 2023 17:39
A PyQt5 widget example that displays two QTreeWidgets side by side, with synchronized scrolling and selection.
"""
Copyright (C) 2023 promto-c
Permission Notice:
- You are free to use, copy, modify, and distribute this software for any purpose.
- No restrictions are imposed on the use of this software.
- You do not need to give credit or include this notice in your work.
- Use at your own risk.
- This software is provided "AS IS" without any warranty, either expressed or implied.
@promto-c
promto-c / freezable_tree_view.py
Last active November 8, 2023 22:23
A PyQt5 widget example that displays two QTreeViews side by side, with synchronized scrolling and selection.
"""
Copyright (C) 2023 promto-c
Permission Notice:
- You are free to use, copy, modify, and distribute this software for any purpose.
- No restrictions are imposed on the use of this software.
- You do not need to give credit or include this notice in your work.
- Use at your own risk.
- This software is provided "AS IS" without any warranty, either expressed or implied.
@promto-c
promto-c / adaptive_padded_double_spin_box.py
Last active November 13, 2023 16:27
Custom PyQt5 Widget: An adaptive, precision-adjustable QDoubleSpinBox with dynamic padding. This specialized double spin box widget automatically adjusts its step increment based on the cursor position relative to the decimal point, and dynamically updates the zero-padding for both the integer and fractional parts as the user inputs or removes d…
"""
Copyright (C) 2023 promto-c
Permission Notice:
- You are free to use, copy, modify, and distribute this software for any purpose.
- No restrictions are imposed on the use of this software.
- You do not need to give credit or include this notice in your work.
- Use at your own risk.
- This software is provided "AS IS" without any warranty, either expressed or implied.
Note: This code is intended primarily as an example. While you can use it freely as described above, be aware that it utilizes PyQt5, which is licensed under GPL v3. Ensure you adhere to PyQt5's licensing terms when using or distributing this code.
@promto-c
promto-c / Understanding_Python_Ellipsis.md
Last active March 28, 2025 11:26
Comprehensive Guide to the Ellipsis in Python: Usage, Examples, and Best Practices

Understanding the Ellipsis (...) in Python

Overview

The Ellipsis object, represented by ..., is a unique, singleton feature in Python's syntax, akin to None. It serves a variety of purposes in different contexts, ranging from a placeholder in code to a tool in advanced programming scenarios.

Table of Contents

  1. Placeholder for Incomplete Code
  2. Advanced Slicing in NumPy
  3. Type Hints for Variadic Parameters
  4. Custom Container Types
from typing import List
from PyQt5 import QtCore, QtGui, QtWidgets
import re, time # Regular expression module for splitting text
class TagLabel(QtWidgets.QLabel):
removed = QtCore.pyqtSignal(str)
def __init__(self, text, parent=None):
super(TagLabel, self).__init__(text, parent)
import bpy
bl_info = {
"name": "Exposure and Gamma in Clip Editor",
"author": "promto-c",
"version": (1, 0),
"blender": (2, 80, 0),
"location": "Clip Editor > Sides > Footage > Viewer Settings",
"description": "Adds exposure and gamma settings to the Clip Editor's Viewer Settings panel.",
"support": "TESTING"