In my program I want to import simplejson or json based on whether the OS the user is on is Windows or Linux. I take the OS name as input from the user. Now, is it correct t
It is not advisable to use to bind json or simplejson with OS platform. simplejson is newer and advanced version of json so we should try to import it first.
Based on python version you can try below way to import json or simplejson
import sys
if sys.version_info > (2, 7):
import simplejson as json
else:
import json