Sorry Cannon, ignore that, it’s incomplete and inaccurate. (other than that…)

> On Feb 15, 2017, at 12:05 PM, Lee Hinde <[email protected]> wrote:
> 
> That isn’t setup to return a value (it just prints it to the console) and 
> it’s not setup to take an argument.
>> On Feb 15, 2017, at 11:57 AM, Cannon Smith via 4D_Tech 
>> <[email protected]> wrote:
>> 
>> I’ve been given a python script which takes JSON and returns JSON with all 
>> the keys alphabetized which is helpful for comparing revisions in version 
>> control. However, I can’t figure out how to use LAUNCH EXTERNAL PROCESS and 
>> pass some JSON to it and get the result back. If anyone here knows how it 
>> can be done, I’d appreciate the help (I know nothing about python). MacOS if 
>> it matters.
>> 
>> Here is the script:
>> 
>> #!/usr/bin/python
>> import fileinput
>> import json
>> if __name__ == "__main__":
>>  jsonStr = ''
>>  for a_line in fileinput.input():
>>    jsonStr = jsonStr + ' ' + a_line.strip()    
>>  jsonObj = json.loads(jsonStr)  
>>  print json.dumps(jsonObj, sort_keys=True, indent=2) 
>> 
>> --
>> Cannon.Smith
>> Synergy Farm Solutions Inc.
>> Hill Spring, AB Canada
>> 403-626-3236
>> <[email protected]>
>> <www.synergyfarmsolutions.com>
>> 
>> 
> 

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to