Re: [Tutor] get key value from Redis instance

2018-05-28 Thread Silviu Chiric
Thank you Danny, indentation and separation of code worked out as you mentioned :) Have a nice day! On Mon, May 28, 2018 at 12:14 AM, Danny Yoo wrote: > > From a first glance: it looks like one of your print statements is not > > vertically aligned with the rest of your print statements, so

Re: [Tutor] get key value from Redis instance

2018-05-27 Thread Steven D'Aprano
On Sun, May 27, 2018 at 08:31:26PM +0200, Silviu Chiric wrote: > try: > conn = redis.StrictRedis( host=' > redis-15838.c44.us-east-1-2.ec2.cloud.redislabs.com', port=15838, > password='DavidLavinia2') You just shared your password with the entire world. > print (conn) > conn.ping()

Re: [Tutor] get key value from Redis instance

2018-05-27 Thread Alan Gauld via Tutor
On 27/05/18 19:31, Silviu Chiric wrote: > Dear all > > I need to get the value of given key from Redis, or both key and value, the > below code snippet fails always, even the connection is okay Please post the output. You print the error trace but we cant see it. Or if that is the the whole outp

Re: [Tutor] get key value from Redis instance

2018-05-27 Thread Danny Yoo
One other recommendation: remove the try/except block for now. Don't use exception handling. We want to use exception handling if we have any significant recovery logic, or if it's important not to expose program errors to the end user. But your situation doesn't match this. In fact, you want to

Re: [Tutor] get key value from Redis instance

2018-05-27 Thread Danny Yoo
> From a first glance: it looks like one of your print statements is not > vertically aligned with the rest of your print statements, so I would > expect Python to be reporting a SyntaxError because of this misalignment. Substitute the word "vertical" with "horizontal". Sorry: I made yet anoth

Re: [Tutor] get key value from Redis instance

2018-05-27 Thread Danny Yoo
On Sun, May 27, 2018 at 3:02 PM Silviu Chiric wrote: > Dear all > I need to get the value of given key from Redis, or both key and value, the > below code snippet fails always, even the connection is okay What is the error you see? Please also include the error message, verbatim. Computer sys

[Tutor] get key value from Redis instance

2018-05-27 Thread Silviu Chiric
Dear all I need to get the value of given key from Redis, or both key and value, the below code snippet fails always, even the connection is okay StrictRedis>> Connected! My code import redis try: conn = redis.StrictRedis( host=' redis-15838.c44.us-east-1-2.ec2.cloud.redislabs.com', port=15