I am having a problem that I'm wondering if anyone else can duplicate (with the attached file)
I create a python script (attached is one that takes 2 shapefiles and combines them into one... ) I put code in to detect if a certain command line argument is provided ( /notify ) and if so, it plays a sound to indicate that it's done. I then call the python script from a batch file with the /notify argument. Here is the problem... in my python script I have several CalculateField calls that use PYTHON_9.3 syntax, after the first CalculateField method is called, the sys.argv "disappear" and are no longer accessible. A bug possibly???
Attached is a zip file that I would like several people to test and see if they get the same results... directions...
1. Unzip the attachment to any directory
2. Run the .bat file. It calls the python script with the /notify argument
3. Observe the output. The python script prints out the sys.argv several times and the 3rd time they are blank...
Any input is greatly appreciated...
Jason
I create a python script (attached is one that takes 2 shapefiles and combines them into one... ) I put code in to detect if a certain command line argument is provided ( /notify ) and if so, it plays a sound to indicate that it's done. I then call the python script from a batch file with the /notify argument. Here is the problem... in my python script I have several CalculateField calls that use PYTHON_9.3 syntax, after the first CalculateField method is called, the sys.argv "disappear" and are no longer accessible. A bug possibly???
Attached is a zip file that I would like several people to test and see if they get the same results... directions...
1. Unzip the attachment to any directory
2. Run the .bat file. It calls the python script with the /notify argument
3. Observe the output. The python script prints out the sys.argv several times and the 3rd time they are blank...
Any input is greatly appreciated...
Jason
This was rejected as designed saying to use os.getcwd() instead of sys.argv[0] as it is more reliable. I would try this method instead.
Brilliant idea... that works...
It would still be interesting to know if this problem exists for other users or not... so for now I will leave the post as "un-answered", however credit goes to you for providing a solution...
To Stephanie:
I cannot view the link given, however your argument is invalid. I am trying to access sys.argv[1], not sys.argv[0]
Jason