Can this be easily done in Python?

Peter Pearson pkpearson at nowhere.invalid
Wed Sep 28 12:45:12 EDT 2016


On Tue, 27 Sep 2016 12:58:40 -0700 (PDT), TUA <kai.peters at gmail.com> 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....


You say "variable", but the use of that word often signals a 
misunderstanding about Python.

Python has "objects".  An object often has a name, and in fact often
has several names.  Attempting to associate an object with "its name"
looks like a Quixotic quest to me.

-- 
To email me, substitute nowhere->runbox, invalid->com.



More information about the Python-list mailing list