项目作者: holychowders

项目描述 :
Calculate Moles of Gas in a Container Using the Ideal Gas Law
高级语言: Python
项目地址: git://github.com/holychowders/calculate_moles_of_gas_in_container.git


Calculate Moles of Gas in a Container Using the Ideal Gas Law

Parameters

  • Pressure of gas (Pascals)
  • Volume of container (litres)
  • Temperature of gas (Kelvin)

Usage

Command Line

The following will prompt for parameters and then output the result:

  1. $ ./calculate_moles_of_gas_in_container.py
  2. Pressure (Pascals): 10_000_000
  3. Volume (litres): 5
  4. Temperature (Kelvin): 300
  5. 20.04650790

The following will process CLI arguments and output the result:

  1. $ ./calculate_moles_of_gas_in_container.py -p 10_000_000 -v 5 -t 300
  2. 20.04650790

Another Python Script

  1. >>> from calculate_moles_of_gas_in_container import main as get_moles
  2. >>> result = get_moles(10_000_000, 5, 300)
  3. >>> print(result)
  4. 20.04650790