[[email protected] ~]# python
Python 2.7.5 (default, Nov 6 2016, 00:28:07)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system("source /home/oracle/.bash_profile")
0
>>> os.system("echo $PATH")
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
0
>>>
なぜPATHが変更されませんか? what the 0意味なぜos.system( "source /home/oracle/.bash_profile")が動作しないのですか
使用 'os.popen()'(サブプロセスがその領域であなたを助けます)、良いアイデアであるとパスを、あなたはglob'モジュール – Gahan