Files
website/content/en/examples/application/job/rabbitmq/worker.py
T
azarnyx 6e557559fe Update worker.py (#12403)
Fix an error reproduced with python3.6.8, python3.5.2, python2.7.12:

$ echo "Hi!"| ./worker.py

Traceback (most recent call last):
  File "./worker.py", line 6, in <module>
    print("Processing " + sys.stdin.lines())
AttributeError: '_io.TextIOWrapper' object has no attribute 'lines'
2019-01-28 11:44:01 -08:00

8 lines
163 B
Python

#!/usr/bin/env python
# Just prints standard out and sleeps for 10 seconds.
import sys
import time
print("Processing " + sys.stdin.readlines()[0])
time.sleep(10)