summaryrefslogtreecommitdiffstats
path: root/qtip/util/export_to.py
diff options
context:
space:
mode:
Diffstat (limited to 'qtip/util/export_to.py')
-rw-r--r--qtip/util/export_to.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/qtip/util/export_to.py b/qtip/util/export_to.py
new file mode 100644
index 00000000..98c39b5f
--- /dev/null
+++ b/qtip/util/export_to.py
@@ -0,0 +1,15 @@
+##############################################################################
+# Copyright (c) 2017 ZTE and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+import json
+
+
+def export_to_file(content, filename):
+ with open(filename, 'w+') as f:
+ f.write(json.dumps(content, indent=2))