Environment Configuration reference:http://www.cnblogs.com/halfacre/archive/2012/07/22/2603848.html
Add the arcpy class library, Arctoolbox, arcgis-bin as shown below.
Windos--preference--pydev
Complete the environment configuration.
Second, get the file path Python method
OS.GETCWD () returns the directory of the current file. If my code file is placed under the C:\Users\scfeng\workspace\arcgispython\src\root\tested package
1 Import OS 2 Print (OS.GETCWD ())
Returns the C:\Users\scfeng\workspace\arcgispython\src\root\tested file path
Print (Os.path.dirname (OS.GETCWD ()))
Return the directory name of pathname path. Gets the previous level file directory of the folder where the script is located C:\Users\scfeng\workspace\arcgispython\src\root
Get the Text.txt file path under the root text folder date:
Os.path.join (Os.path.dirname (OS.GETCWD ()),"date","text.txt" )
Print return: C:\Users\scfeng\workspace\arcgispython\src\root\date\text.txt
Elipse+pydev+python Developing an ArcGIS scripting program