Python Tips
2015-01-21 本文已影响237人
AlexZhao
- Python中如何获取程序运行的文件夹目录的绝对路径
# -*- coding: utf-8 -*-
import os
print os.path.dirname(os.path.realpath(__file__))
# -*- coding: utf-8 -*-
import os
print os.path.dirname(os.path.realpath(__file__))