summaryrefslogtreecommitdiff
path: root/demo3/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'demo3/utils.py')
-rw-r--r--demo3/utils.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/demo3/utils.py b/demo3/utils.py
new file mode 100644
index 0000000..67e066f
--- /dev/null
+++ b/demo3/utils.py
@@ -0,0 +1,15 @@
+# Python modules
+import sys
+
+
+QUEUE_NAME = "/my_message_queue"
+
+
+PY_MAJOR_VERSION = sys.version_info[0]
+
+def get_input():
+ """Get input from user, Python 2.x and 3.x compatible"""
+ if PY_MAJOR_VERSION > 2:
+ return input()
+ else:
+ return raw_input()