1

in the Program "Grapher" from Golden Software, you're writing in a modified script-language, based on BASIC. I want to run the script I wrote in ArcGIS either using a toolbox or as an arcpy interface.

How do I run the BASIC script in ArcGIS?

I'm working with ArcMap 10.3.1

I found a solution to open "Surfer"(another app from Golden Software), but not Grapher

import win32com.client 
def main(): 
    app = win32com.client.Dispatch("Surfer.Application") 
    plot = app.Documents.Add(1) 
    app.Visible = True 
main()

closed as too broad by Vince, whyzar, PolyGeo Sep 11 '17 at 11:37

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    ArcGIS uses Python to avoid the use of custom languages. Python is robust enough as a language to write a BASIC interpreter, but the development of same is not a GIS task, nor is it sufficiently focused to be appropriate anywhere in the Stack family of exchanges.. – Vince Sep 11 '17 at 10:19
1

The subprocess module should do the job:

import subprocess
# ... do what you need to do
grapher = "\path\to\grapher.exe"
x_opt = '-x'
bas_file = "\path\to\filename.bas"
result = subprocess.check_output([grapher, x_opt, bas_file])
print result 

I'm showing subprocess.check_output but depending on what Grapher does you might use subprocess.call or other subprocess functions.

Not the answer you're looking for? Browse other questions tagged or ask your own question.