Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

env.workspace - how to navigate "up" one folder?

$
0
0
I am familiar with setting the env.workspace parameter in arcpy. That allows me to work within subfolders of the workspace, eg:

Code:

layer = arcpy.mapping.Layer("Sub\Test.shp")
But how do I do the opposite, ie go up one level in the folder tree?

This doesn't work:

Code:

layer = arcpy.mapping.Layer("..\Test.shp")
Is there an easy way to go up a level from the workspace path? Or is it not possible?

Thanks

Viewing all articles
Browse latest Browse all 2485

Trending Articles