Skip to main content
deleted 50 characters in body; edited tags
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

I have two ArcGIS python scripts. One is a primary python script that calls a number of functions from a second python script. Everything works well, i.e. primary tool calls and uses functions from a second script, when the two scripts are placed in the same directory and the primary python script is NOT embedded into python toolbox. However when the primary python script gets embedded into ArcGIS toolbox, the second script cannot be access any more by the primary script and therefore cannot be imported into the primary script as a module and functions cannot be used.

The work around would be to copy over all functions from the second script to the primary script or to copy second script into the toolbox directory but that is not the proper way to solve this issue.

Is it possible within ArcGIS to embed a script into a python toolbox with other scripts that are used by the primary script?

Any help will be appreciated.

Thank you

I have two ArcGIS python scripts. One is a primary python script that calls a number of functions from a second python script. Everything works well, i.e. primary tool calls and uses functions from a second script, when the two scripts are placed in the same directory and the primary python script is NOT embedded into python toolbox. However when the primary python script gets embedded into ArcGIS toolbox, the second script cannot be access any more by the primary script and therefore cannot be imported into the primary script as a module and functions cannot be used.

The work around would be to copy over all functions from the second script to the primary script or to copy second script into the toolbox directory but that is not the proper way to solve this issue.

Is it possible within ArcGIS to embed a script into a python toolbox with other scripts that are used by the primary script?

Any help will be appreciated.

Thank you

I have two ArcGIS python scripts. One is a primary python script that calls a number of functions from a second python script. Everything works well, i.e. primary tool calls and uses functions from a second script, when the two scripts are placed in the same directory and the primary python script is NOT embedded into python toolbox. However when the primary python script gets embedded into ArcGIS toolbox, the second script cannot be access any more by the primary script and therefore cannot be imported into the primary script as a module and functions cannot be used.

The work around would be to copy over all functions from the second script to the primary script or to copy second script into the toolbox directory but that is not the proper way to solve this issue.

Is it possible within ArcGIS to embed a script into a python toolbox with other scripts that are used by the primary script?

deleted 338 characters in body
Source Link
Kasia
  • 31
  • 1
  • 6

I have two ArcGIS python scripts. One is a primary python script that calls a number of functions from a second python script. Everything works well, i.e. primary tool calls and uses functions from a second script, when the two scripts are placed in the same directory and the primary python script is NOT embedded into python toolbox. However when the primary python script gets embedded into ArcGIS toolbox, the second script cannot be access any more by the primary script and therefore cannot be imported into the primary script as a module and functions cannot be used.

The work around would be to copy over all functions from the second script to the primary script or to copy second script into the toolbox directory but that is not the proper way to solve this issue.

Is it possible within ArcGIS to embed a script into a python toolbox with other scripts that are used by the primary script?

Any help will be appreciated.

Thank you

import arcgisscripting,arcpy from arcpy 
import env 
import testFunction 
testFunction.postphoto() 

Second script content:

import arcgisscripting,arcpy 
from arcpy import env 
def postphoto(): 
  gp = arcgisscripting.create() 
  gp.overwriteoutput = 1 
  gp.addmessage("Hello")

I have two ArcGIS python scripts. One is a primary python script that calls a number of functions from a second python script. Everything works well, i.e. primary tool calls and uses functions from a second script, when the two scripts are placed in the same directory and the primary python script is NOT embedded into python toolbox. However when the primary python script gets embedded into ArcGIS toolbox, the second script cannot be access any more by the primary script and therefore cannot be imported into the primary script as a module and functions cannot be used.

The work around would be to copy over all functions from the second script to the primary script or to copy second script into the toolbox directory but that is not the proper way to solve this issue.

Is it possible within ArcGIS to embed a script into a python toolbox with other scripts that are used by the primary script?

Any help will be appreciated.

Thank you

import arcgisscripting,arcpy from arcpy 
import env 
import testFunction 
testFunction.postphoto() 

Second script content:

import arcgisscripting,arcpy 
from arcpy import env 
def postphoto(): 
  gp = arcgisscripting.create() 
  gp.overwriteoutput = 1 
  gp.addmessage("Hello")

I have two ArcGIS python scripts. One is a primary python script that calls a number of functions from a second python script. Everything works well, i.e. primary tool calls and uses functions from a second script, when the two scripts are placed in the same directory and the primary python script is NOT embedded into python toolbox. However when the primary python script gets embedded into ArcGIS toolbox, the second script cannot be access any more by the primary script and therefore cannot be imported into the primary script as a module and functions cannot be used.

The work around would be to copy over all functions from the second script to the primary script or to copy second script into the toolbox directory but that is not the proper way to solve this issue.

Is it possible within ArcGIS to embed a script into a python toolbox with other scripts that are used by the primary script?

Any help will be appreciated.

Thank you

added 340 characters in body
Source Link
artwork21
  • 35.2k
  • 8
  • 67
  • 134

I have two ArcGIS python scripts. One is a primary python script that calls a number of functions from a second python script. Everything works well, i.e. primary tool calls and uses functions from a second script, when the two scripts are placed in the same directory and the primary python script is NOT embedded into python toolbox. However when the primary python script gets embedded into ArcGIS toolbox, the second script cannot be access any more by the primary script and therefore cannot be imported into the primary script as a module and functions cannot be used.

The work around would be to copy over all functions from the second script to the primary script or to copy second script into the toolbox directory but that is not the proper way to solve this issue.

Is it possible within ArcGIS to embed a script into a python toolbox with other scripts that are used by the primary script?

Any help will be appreciated.

Thank you

import arcgisscripting,arcpy from arcpy 
import env 
import testFunction 
testFunction.postphoto() 

Second script content:

import arcgisscripting,arcpy 
from arcpy import env 
def postphoto(): 
  gp = arcgisscripting.create() 
  gp.overwriteoutput = 1 
  gp.addmessage("Hello")

I have two ArcGIS python scripts. One is a primary python script that calls a number of functions from a second python script. Everything works well, i.e. primary tool calls and uses functions from a second script, when the two scripts are placed in the same directory and the primary python script is NOT embedded into python toolbox. However when the primary python script gets embedded into ArcGIS toolbox, the second script cannot be access any more by the primary script and therefore cannot be imported into the primary script as a module and functions cannot be used.

The work around would be to copy over all functions from the second script to the primary script or to copy second script into the toolbox directory but that is not the proper way to solve this issue.

Is it possible within ArcGIS to embed a script into a python toolbox with other scripts that are used by the primary script?

Any help will be appreciated.

Thank you

I have two ArcGIS python scripts. One is a primary python script that calls a number of functions from a second python script. Everything works well, i.e. primary tool calls and uses functions from a second script, when the two scripts are placed in the same directory and the primary python script is NOT embedded into python toolbox. However when the primary python script gets embedded into ArcGIS toolbox, the second script cannot be access any more by the primary script and therefore cannot be imported into the primary script as a module and functions cannot be used.

The work around would be to copy over all functions from the second script to the primary script or to copy second script into the toolbox directory but that is not the proper way to solve this issue.

Is it possible within ArcGIS to embed a script into a python toolbox with other scripts that are used by the primary script?

Any help will be appreciated.

Thank you

import arcgisscripting,arcpy from arcpy 
import env 
import testFunction 
testFunction.postphoto() 

Second script content:

import arcgisscripting,arcpy 
from arcpy import env 
def postphoto(): 
  gp = arcgisscripting.create() 
  gp.overwriteoutput = 1 
  gp.addmessage("Hello")
edited tags
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Loading
edited tags
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Loading
Source Link
Kasia
  • 31
  • 1
  • 6
Loading