1

I would like to run a script that uses some tools from the ET Geowizards toolbox. I have a valid license for it but sometimes the license server at work is off. If the server is off then some of the ET Geowizards tools mentioned above are limited to processing only 100 features.

I can import the ET Geowizards toolbox via arcpy.ImportToolbox with no problem, import works even if the license is not available. Bad thing is that I don´t know if the server is running or not at the time of arcpy.ImportToolbox. I must wait for the script execution if it raise an error or not. If an error has been raised, then the server with the license is off.

Is there some python/arcpy way of checking the availability of the ET Geowizards license on the server? Something like arcpy.CheckExtension for ArcGIS Extensions.

Running on ArcGIS for Desktop 10.1 Basic + SP1, ET Geowizards 10.2 for ArcGIS 10.1, Win8 64 bit

1 Answer 1

2

If it's simply a matter of whether or not your license server is running, you could ping it, parse the response, and then act accordingly. Something like:

import subprocess
p = subprocess.Popen(["ping", "<lic server>"], stdout=subprocess.PIPE)
print p.communicate()
('\r\nPinging <lic server> [184.154.235.5] with 32 bytes of data:\r\nRepl
y from 184.154.235.5: bytes=32 time=66ms TTL=49\r\nReply from 184.154.235.5: byt
es=32 time=69ms TTL=49\r\nReply from 184.154.235.5: bytes=32 time=66ms TTL=49\r\
nReply from 184.154.235.5: bytes=32 time=66ms TTL=49\r\n\r\nPing statistics for
184.154.235.5:\r\n    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),\r\nAp
proximate round trip times in milli-seconds:\r\n    Minimum = 66ms, Maximum = 69
ms, Average = 66ms\r\n', None)
1
  • Thank you for your solution, as the subprocess module is beyond my current python knowledge, it´s a great opportunity to learn something new! Marking answer as accepted.
    – jonlew
    May 26, 2016 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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