0

I'm trying to retrofit a bit of code a friend gave me. This is what a snippet of what I have right now:

print 'Message is', message
md5Hash = hashlib.md5(message).hexdigest()
print 'Hash is', md5Hash
tempName = md5Hash + '.glados.wav'
doneName = 'ok-' + md5Hash + '.done.wav'
for f in os.listdir(filesPath):
    if f[-4:] in ('.wav', '.mdd'):
            os.remove(filesPath + os.sep + f)

Right now, it is receiving the "message" variable from an argument passed when the script is run. What I would like to do is take the output from a Redis command:

LPOP myList
"one"

and put that "one" as the "message" python variable.

There's probably an easy way to do this that I'm overlooking, so any help would be greatly appreciated.

1 Answer 1

3

Um... use redis-py?

import redis
r = redis.Redis(host='localhost', port=6379, db=0)
message = r.lpop("myList")
# ...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.