Solved

adding a line to .bash_profile and relaoding from python

Posted on 2011-03-04
1
576 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
Comment Utility
#!/usr/bin/env python
import os
os.environ['A']=B
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

VM backups can be lost due to a number of reasons: accidental backup deletion, backup file corruption, disk failure, lost or stolen hardware, malicious attack, or due to some other undesired and unpredicted event. Thus, having more than one copy of …
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now