os.path.dirname(os.path.abspath(__file__))

os.path.dirname(os.path.abspath(__file__))

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import absolute_import
from __future__ import print_function
from __future__ import division

import os
import sys

sys.path.append(os.path.dirname(os.path.abspath(__file__)))
current_directory = os.path.dirname(os.path.abspath(__file__))
ROOT_PATH = os.path.abspath(current_directory + '/..')

print(16 * "++--")
print("current_directory:", current_directory)

print(16 * "++--")
print("ROOT_PATH:", ROOT_PATH)
/usr/bin/python2.7 /home/strong/tensorflow_work/R2CNN_Faster-RCNN_Tensorflow/yongqiang.py
++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--
current_directory: /home/strong/tensorflow_work/R2CNN_Faster-RCNN_Tensorflow
++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--
ROOT_PATH: /home/strong/tensorflow_work

Process finished with exit code 0

你可能感兴趣的:(Python,3.x,-,Python,2.x)