Elipse+pydev+python Developing an ArcGIS scripting program

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.