All pastes #55459 Raw Edit

Someone

public text v1 · immutable
#55459 ·published 2006-05-13 00:27 UTC
rendered paste body
echo $PS1
${debian_chroot:+($debian_chroot)}\u@\h:\w\$

This is shell script. i want ths value in python

my cmd was

In [1]: import os

In [2]: os.environ['PS1']
---------------------------------------------------------------------------
exceptions.KeyError                                  Traceback (most recent call last)

/home/venkat/pyautosuite/terminal/<ipython console>

/usr/lib/python2.4/UserDict.py in __getitem__(self, key)
     15             return cmp(self.data, dict)
     16     def __len__(self): return len(self.data)
---> 17     def __getitem__(self, key): return self.data[key]
     18     def __setitem__(self, key, item): self.data[key] = item
     19     def __delitem__(self, key): del self.data[key]

KeyError: 'PS1'

In [3]: os.getenv('PS1')

In [4]: