shell access

Arnaud Delobelle arnodel at googlemail.com
Mon Jan 11 16:16:55 EST 2010


monkeys paw <user at example.net> writes:

> How do you access the command line from the
> python interpreter?
>
> on unix:
>
> type python
>
>>>> print 'hey'
> 'hey'
>>>>   # I want to access the shell here, how do i do that?

Like this?

>>> import os
>>> os.system('echo $HOME')
/Users/arno
0
>>> 

-- 
Arnaud



More information about the Python-list mailing list