teaching:progappchim:chempy

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
teaching:progappchim:chempy [2022/03/15 12:41] – créée villersdteaching:progappchim:chempy [2023/03/20 12:23] (Version actuelle) villersd
Ligne 1: Ligne 1:
 ====== ChemPy ====== ====== ChemPy ======
   * [[https://pypi.org/project/chempy/]] : installation et documentation   * [[https://pypi.org/project/chempy/]] : installation et documentation
 +
 +<code python prog-test-02.py>
 +#!/usr/bin/env python3
 +# -*- coding: utf-8 -*-
 +"""
 +Created on Tue May  4 10:25:51 2021
 +
 +@author: villersd
 +Librairie chempy :
 +https://pypi.org/project/chempy/#documentation
 +https://github.com/bjodah/chempy
 +installation Linux : conda install -c bjodah chempy pytest
 +installation Windows & OS X :
 +python -m pip install chempy pytest
 +python -m pytest -rs -W ignore::chempy.ChemPyDeprecationWarning --pyargs chempy
 +"""
 +from chempy import Substance
 +from chempy import balance_stoichiometry 
 +from pprint import pprint
 +
 +# A=input('entrer le réactif 1')
 +# B=input('entrer le réactif 2')
 +# C=input('entrer le produit 1')
 +# D=input('entrer le produit 2')
 +# E=input('entrer le produit 3'
 +# F=input('entrer le produit 4')
 +A = 'NH4ClO4'
 +B = 'Al'
 +C = 'Al2O3'
 +D = 'HCl'
 +E = 'H2O'
 +F = 'N2'
 +
 +print(A, B, C, D, E, F)
 +
 +reac, prod = balance_stoichiometry({A, B}, {C, D, E, F})
 +pprint(dict(reac))
 +pprint(dict(prod))
 +
 +</code>
  • teaching/progappchim/chempy.txt
  • Dernière modification : 2023/03/20 12:23
  • de villersd