Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| teaching:progappchim:chempy [2022/03/15 12:41] – créée villersd | teaching:progappchim:chempy [2023/03/20 12:23] (Version actuelle) – villersd | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== ChemPy ====== | ====== ChemPy ====== | ||
| * [[https:// | * [[https:// | ||
| + | |||
| + | <code python prog-test-02.py> | ||
| + | # | ||
| + | # -*- coding: utf-8 -*- | ||
| + | """ | ||
| + | Created on Tue May 4 10:25:51 2021 | ||
| + | |||
| + | @author: villersd | ||
| + | Librairie chempy : | ||
| + | https:// | ||
| + | https:// | ||
| + | installation Linux : conda install -c bjodah chempy pytest | ||
| + | installation Windows & OS X : | ||
| + | python -m pip install chempy pytest | ||
| + | python -m pytest -rs -W ignore:: | ||
| + | """ | ||
| + | from chempy import Substance | ||
| + | from chempy import balance_stoichiometry | ||
| + | from pprint import pprint | ||
| + | |||
| + | # A=input(' | ||
| + | # B=input(' | ||
| + | # C=input(' | ||
| + | # D=input(' | ||
| + | # E=input(' | ||
| + | # F=input(' | ||
| + | A = ' | ||
| + | B = ' | ||
| + | C = ' | ||
| + | D = ' | ||
| + | E = ' | ||
| + | F = ' | ||
| + | |||
| + | print(A, B, C, D, E, F) | ||
| + | |||
| + | reac, prod = balance_stoichiometry({A, | ||
| + | pprint(dict(reac)) | ||
| + | pprint(dict(prod)) | ||
| + | |||
| + | </ | ||