I need a help in making variables as ENV in python, so that I can see that variable by using 'export' command in Linux. So I tested a below short script and I can see variable using export command. But the problem is that, below two command didn't work.
var1 = os.environ['LINE']
print(var1)
Can you guide me how can I get this solved ?
import os
import json
import sys
Name = "a1"
def func():
var = 'My name is ' + '' + Name
os.putenv('LINE', var)
os.system('bash')
func()
var1 = os.environ['LINE']
print(var1)
Output:
export | grep LINE
declare -x LINE="My name is a1"