On Tue, Sep 27, 2016, at 15:58, TUA wrote:
> Is the following possible in Python?
> 
> Given how the line below works
> 
> TransactionTerms = 'TransactionTerms'
> 
> 
> have something like
> 
> TransactionTerms = <some Python code here>
> 
> that sets the variable TransactionTerms to its own name as string
> representation without having to specify it explicitly as in the line
> above....

What are you trying to do?

If you're trying to avoid saying it twice:

exec('%s=%r'%['TransactionTerms']*2)

If you're trying to avoid having it as a string:

def TransactionTerms(): pass
TransactionTerms = TransactionTerms.__name__
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to