On Thursday, December 25, 2014 9:19:25 AM UTC-6, JC wrote: > Hello, > > Is it possible in python: > > if ((x = a(b,c)) == 'TRUE'): > print x > > Thanks.
Could you not simply rephrase: result = foo() if result == 'TRUE': do_something() Of course, another oddity is fact that you're "seemingly" using a string to represent what should be a Boolean value. You may want to check out the contextlib, which allows you to create custom context managers utilizing the "with" statement. path = 'C:\d\e\f\g.txt with open(path) as f: do_something() -- https://mail.python.org/mailman/listinfo/python-list