![]() ![]() PythonExePath = r'C:\Python27\ArcGIS圆410.8\python. Sys.argv = Ĭommand = 'python f:\\scratch\\test.py file_from_command' Ryan has posted a nice code sample here: Python Subprocess.Popen from a thread. NewInputFile = "f:\\scratch\\" outFile ".txt" To launch a program in a non blocking way but still being able to see the output of program, the program has to be launched in a separate thread or process. Import arcpy #if this is commented, all three methods work otherwise only execfile works ''' script that's called by 3 methods below: #import arcpy #works whether or not this is commented I can't attach my scripts here, so they are pasted below: The called script is commented out. I'm attaching two scripts: test1.py will call test.py with the three different methods - if they are successful, they will write out text files indicating which method was used. ImportError: DLL load failed: %1 is not a valid Win32 application." ![]() The error that occurs when importing arcpy is this:įile "c:\program files (x86)\arcgis\desktop10.8\ArcPy\arcpy\_init_.py", line 22, in įile "c:\program files (x86)\arcgis\desktop10.8\ArcPy\arcpy\geoprocessing\_init_.py", line 14, in įile "c:\program files (x86)\arcgis\desktop10.8\ArcPy\arcpy\geoprocessing\_base.py", line 14, in I suspect it is something to do with my 64-bit background geoprocessing, which I just reinstalled this morning. These all work - but, the first one forces the program to wait and the other ones will fail when it tries to import arcpy. I have three different methods of calling the script - execfile(), os.system(), and subprocess.popen(). I need to call a python script from another script, and not wait (this is a script to start multiple other scripts).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |