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
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. |
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
import datetime | |
import json | |
from pathlib import Path | |
class ExtendedJsonEncoder(json.JSONEncoder): | |
""" | |
Additional opiniated support for more basic object types. | |
Usage sample: :: |
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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
""" | |
A script to extract installed packages versions from a Buildout project. | |
Install | |
******* | |
This is a "one man army" script without specific requirements. Just drop the file in | |
your project and use it. |
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
""" | |
Command line script to rename media files. | |
Prerequisite: | |
* Python >= 3.6; | |
* Unicode and Emoji fonts enabled in your terminal console; | |
""" | |
import json |
NewerOlder