summaryrefslogtreecommitdiff
path: root/examples/py-json-stdout/json-stdout.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/py-json-stdout/json-stdout.py')
-rwxr-xr-xexamples/py-json-stdout/json-stdout.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/examples/py-json-stdout/json-stdout.py b/examples/py-json-stdout/json-stdout.py
index 9f58d161e..a14447745 100755
--- a/examples/py-json-stdout/json-stdout.py
+++ b/examples/py-json-stdout/json-stdout.py
@@ -3,10 +3,14 @@
import os
import sys
-sys.path.append(os.path.dirname(sys.argv[0]) + '/../../dependencies')
-import nDPIsrvd
-from nDPIsrvd import nDPIsrvdSocket, TermColor
-
+sys.path.append(os.path.dirname(sys.argv[0]) + '/../usr/share/nDPId')
+try:
+ import nDPIsrvd
+ from nDPIsrvd import nDPIsrvdSocket, TermColor
+except ModuleNotFoundError:
+ sys.path.append(os.path.dirname(sys.argv[0]) + '/../../dependencies')
+ import nDPIsrvd
+ from nDPIsrvd import nDPIsrvdSocket, TermColor
def onJsonLineRecvd(json_dict, current_flow, global_user_data):
print(json_dict)