Developpez.com

Python

Choisissez la catégorie, puis la rubrique :

25.10.1 Command Line Usage


25.10.1 Command Line Usage

The trace module can be invoked from the command line. It can be as simple as

python -m trace --count somefile.py ...

The above will generate annotated listings of all Python modules imported during the execution of somefile.py.

The following command-line arguments are supported:

--trace, -t
Display lines as they are executed.

--count, -c
Produce a set of annotated listing files upon program completion that shows how many times each statement was executed.

--report, -r
Produce an annotated list from an earlier program run that used the --count and --file arguments.

--no-report, -R
Do not generate annotated listings. This is useful if you intend to make several runs with --count then produce a single set of annotated listings at the end.

--listfuncs, -l
List the functions executed by running the program.

--trackcalls, -T
Generate calling relationships exposed by running the program.

--file, -f
Name a file containing (or to contain) counts.

--coverdir, -C
Name a directory in which to save annotated listing files.

--missing, -m
When generating annotated listings, mark lines which were not executed with `>>>>>>'.

--summary, -s
When using --count or --report, write a brief summary to stdout for each file processed.

--ignore-module
Ignore the named module and its submodules (if it is a package). May be given multiple times.

--ignore-dir
Ignore all modules and packages in the named directory and subdirectories. May be given multiple times.

See About this document... for information on suggesting changes.
Les développeurs logiciels actifs sont actuellement estimés à un peu moins de 19 millions dans le monde, 13 millions d'entre eux seraient des pros
Voici l'état de l'écosystème des développeurs en 2019 : l'évolution du monde du code, d'après une enquête menée par Jetbrains
Python 3.8.0 : un aperçu des fonctionnalités attendues pour la version stable du langage de programmation
Apprendre Python et s'initier à la programmation - Partie 2 : Programmation avancée, un cours de Sébastien Combéfis
Contacter le responsable de la rubrique Python

Partenaire : Hébergement Web