Thanks for the helpful update, Robert!
If you were planning on executing the script from Windows Task Scheduler, would you move the comments hash from the sys.argv variables and put them in front of the arcpy.GetParameterAsText variables in your script, or are you just explaining where those variable will receive their arguments from?
In other words, do we need to use sys.argv for Scheduled Tasks?
Correct me if I am wrong, but it seems like the Python window is basically just an interactive window (not a full blown IDE), and not really geared for running a full script in (just one line at a time).
import sys one = sys.argv[1] two = sys.argv[2] message = open("c:/temp/log.txt", "a") message.write(one+"\n") message.write(two+"\n")
and what is the syntax for calling a .py script ? I can't just type the name of the python file into the command line.
a = "c:\\data\\my.gdb\\featureclass" b = 5 func(a, b)
def mainfunc(a, b): return do_some_stuff(a, b) if __name__ == "__main__": import sys mainfunc(sys.argv[1], sys.argv[2])
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.