Solved

adding a line to .bash_profile and relaoding from python

Posted on 2011-03-04
1
595 Views
Last Modified: 2012-06-27
Hi

From python I need to sen and environmental variable e.g.

export TEST=/usr/test

I tried this in python
cmd = "echo export VVG=/Users >> ~/.bash_profile"
os.system(cmd)
cmd = "source ~/.bash_profile"
os.system(cmd)
cmd = """echo $VVG"""
print os.system(cmd)

I saved to bash
restated bash
But....the echo $VVG did not work

How can I make it take?

Thanks
0
Comment
Question by:dmontgom
1 Comment
 
LVL 31

Accepted Solution

by:
farzanj earned 125 total points
ID: 35035927
#!/usr/bin/env python
import os
os.environ['A']=B
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question