Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Coder avec une
Intelligence Artificielle
Voir le programme détaillé
Module « flask.json »

Fonction dump - module flask.json

Signature de la fonction dump

def dump(obj: 't.Any', fp: 't.IO[str]', **kwargs: 't.Any') -> 'None' 

Description

help(flask.json.dump)

Serialize data as JSON and write to a file.

If :data:`~flask.current_app` is available, it will use its
:meth:`app.json.dump() <flask.json.provider.JSONProvider.dump>`
method, otherwise it will use :func:`json.dump`.

:param obj: The data to serialize.
:param fp: A file opened for writing text. Should use the UTF-8
    encoding to be valid JSON.
:param kwargs: Arguments passed to the ``dump`` implementation.

.. versionchanged:: 2.3
    The ``app`` parameter was removed.

.. versionchanged:: 2.2
    Calls ``current_app.json.dump``, allowing an app to override
    the behavior.

.. versionchanged:: 2.0
    Writing to a binary file, and the ``encoding`` argument, will be
    removed in Flask 2.1.


Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les compléments
Voir le programme détaillé