Le but ici est de produire un périphérique pour détecter la présence d'une puce RFID à longue distance (minimum 30cm) et qui soit capable d'envoyer l'information à un
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
""" | |
A commandline script to get project dependencies informations using Libraries.io API. | |
This requires a valid API key from 'Libraries.io' that you can get just by register | |
to the site itself, you will need to write it to a file to give as command argument. | |
Requirements: | |
* requests>=2.32.3; | |
* semantic-version>=2.10.0; |
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
""" | |
This is a demonstration and tutorial for "schema" library until its implementation is | |
finished since library documentation is painful to understand. | |
Schema validate data values and possibly coerces them if instructed to do so. | |
Basically schema respect given scheme structure. A callable item (like list or dict) is | |
followed recursively, a type object (like int or str) expect a value in this right type | |
and almost everything (like "foo" or 42) else is assumed as an exact value expected. |
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
""" | |
Proof of concept script to use MediaInfo to get metadatas from a video file. | |
Although this script have been done only for videos, MediaInfo also allow to read infos from audio and images. | |
First, this have been done with Python 3.10 but it should probably work with Python 3.8 | |
MediaInfo library is required to be installed on your system, see: | |
https://github.com/MediaArea/MediaInfo |
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
In Python 3, this mental model is pretty straight-forward: | |
Encoding is the process of converting a str to a bytes object | |
Decoding is the process of converting a bytes object to a str | |
┏━━━━━━━┓ ┏━━━━━━━┓ | |
┃ ┃ -> encoding -> ┃ ┃ | |
┃ str ┃ ┃ bytes ┃ |
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
""" | |
This requires ``Python>=3.8`` and ``packaging>=23.1``. | |
""" | |
from importlib.metadata import requires | |
from pathlib import Path | |
from packaging.requirements import Requirement | |
class RequirementBuilder: |
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
help: | |
@echo "Please use 'make <target> [<target>...]' where <target> is one of" | |
@echo | |
@echo " Cleaning" | |
@echo " ========" | |
@echo | |
@echo " clean -- to clean EVERYTHING" | |
@echo |
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
""" | |
A test suite use for research&development and that demonstrate an issue with | |
'dict_to_tree' | |
It has been started with custom Node object sample: | |
https://bigtree.readthedocs.io/en/latest/others/tips.html#population-node-add-functionality-method-property | |
Opposed to original sample the percentage attribute have been disabled else it causes | |
"division by zero" and prevent to make demonstration. |
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
<form action="/sample/" method="post"> | |
{% csrf_token %} | |
{% if form.non_field_errors %}{% spaceless %} | |
<div class="non_field_errors">{{ form.non_field_errors }}</div> | |
{% endspaceless %}{% endif %} | |
{% for field in form %} | |
<div class="{{ field.html_name }}__container"> | |
{% for error in field.errors %} |
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
from django.contrib import admin | |
from django.utils.translation import gettext_lazy as _ | |
from ..choices import get_language_choices, get_language_default | |
class DeprecatedLanguageListFilter(admin.SimpleListFilter): | |
""" | |
Add Human-readable language title as defined in LANGUAGES setting. |
NewerOlder