Skip to content
Advertisement

A function that can be stored on memory

suppose we have two python programs. calculate.py and show_results.py.

When calculate.py program runs on terminal, it returns a variable (let’s say a list called result) to the computer memory. And when we run show_results.py on terminal, it prints the result from the programs before.

Suppose the result of the calculate.py is a list A = [83, 22]. So it will be like below on terminal:

$:~ python3 calculate.py
-------Calculation Done--------
$:~ python3 show_results.py
83, 22

Any suggestions ?

Any response will be appreciated.

Advertisement

Answer

As @blue_note suggests, it will not possible from kernal level. 1) You can store first script result into filesystem/database to retrieve later. 2) You can write a program which will handle all these functionality in one python script if you run it together.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement