浙江省高等学校教师教育理论培训

微信搜索“毛凌志岗前心得”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

[Tutor] how to change the current working directory path in ipython.

[Tutor] how to change the current working directory path in ipython.

Joel Goldstick joel.goldstick at gmail.com
Wed Feb 8 15:33:01 CET 2012

 


On Wed, Feb 8, 2012 at 9:24 AM, Debashish Saha <silideba at gmail.com> wrote:
> how to change  the current working directory path in ipython.
>
> my current directory path is
>                       pwd
>               Out[2]: u'C:\\Users\\as'
>
> now if i want to take the path to a subfolder of above
> 'C:\\Users\\as', what do i have to do?
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor


Try looking here:
http://docs.python.org/tutorial/stdlib.html#operating-system-interface

There is a module in python called os

Here is an example from the documentation

>>> import os
>>> os.getcwd()      # Return the current working directory
'C:\\Python26'
>>> os.chdir('/server/accesslogs')   # Change current working directory
>>> os.system('mkdir today')   # Run the command mkdir in the system shell
0

-- 
Joel Goldstick
posted on 2013-01-16 11:25  lexus  阅读(357)  评论(0编辑  收藏  举报