jeudi 28 janvier 2021

How to get output of a normally distributed random number using python function in a range?

The question is related to:

  • How to get output of a normally distributed random number useing python function in a range?

Touching conditions:

  • Call python file with python function by bash
  • Give parameter from bash to python
  • Echo output of python function by bash

I already know the following:

bash.sh

#!/bin/bash
var_output= $(echo $'./python.py ')
echo $var_output

python.py

#!/usr/bin/env python3

import random

def normally_distributed_random_number():
    mu=10
    sigma=100
    print(random.normalvariate(mu, sigma))

normally_distributed_random_number()



Aucun commentaire:

Enregistrer un commentaire