Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

adding a line to .bash_profile and relaoding from python

Posted on 2011-03-04
1
Medium Priority
?
643 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 500 total points
ID: 35035927
#!/usr/bin/env python
import os
os.environ['A']=B
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

When we have a dead host and we lose all connections to the ESXi, and we need to find a way to move all VMs from that dead ESXi host.
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
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…

824 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