shell access

Arnaud Delobelle arnodel at googlemail.com
Mon Jan 11 22:16:55 CET 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