-2

The function is defined in tempconv.py file as

def fahr2cels(fahr) :
    cels = 5/9 * (fahr - 32)
    return cels 

and there is a text file called tempmax_cels.txt which is a line of number. I want to write a command line in a bash shell like

python tempconv.py < tempmax_cels.txt 

so the computer can accept the text file as an standard input. How can I correct tempconv.py to do it? (using import system module)

khelwood
  • 55,782
  • 14
  • 81
  • 108

1 Answers1

0

This answer gives all the details for your question, better than what i could have done: https://stackoverflow.com/a/38670261/12602635

Haytek
  • 93
  • 1
  • 8