phoenix13

导航

 

1. show & change directory

>>> import os
>>> os.getcwd()
'/home/user'
>>> os.chdir("/tmp/")
>>> os.getcwd()
'/tmp'

2.  execute .py from shell

>>>import sys
>>>sys.argv = ['', 'arg1', 'arg2']
>>>execfile('myscript.py')

还有个什么subprocess的,没搞懂

posted on 2012-12-02 12:10  phoenix13  阅读(153)  评论(0编辑  收藏  举报