Standalone Python Script

809
2
Jump to solution
09-05-2014 04:29 AM
MattZetterman
New Contributor III

So I'm a complete newbie when it comes to python. I created a python script to create a join using model builder that works great within ArcGIS. With that said I want to be able to run the script within Windows Task Scheduler and am having trouble making it work. The join is between a feature class and a table. When I look at the python script the full path for the table is created but the feature class is referenced by it's layer name without a full path. How do I create a path for the feature class? I assumed it would be something like: C:\filegeodatabase.gdb\featuredataset\featureclass but when I try running it with pythonwin I get at "Returned exit code 0".

Any thoughts on what I'm doing wrong?

0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor

Hi Matt,

When specifying an absolute path, you will need to adjust the syntax.  Any of the following will work:

fc = r"C:\temp\test.gdb\dataset\parcels"

fc = "C:/temp/test.gdb/dataset/parcels"

fc = "C:\\temp\\test.gdb\\dataset\\parcels"

View solution in original post

2 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Matt,

When specifying an absolute path, you will need to adjust the syntax.  Any of the following will work:

fc = r"C:\temp\test.gdb\dataset\parcels"

fc = "C:/temp/test.gdb/dataset/parcels"

fc = "C:\\temp\\test.gdb\\dataset\\parcels"

MattZetterman
New Contributor III

Works like a charm, thank you.

0 Kudos