On Friday, November 30, 2018 at 3:59:40 PM UTC-6, saad khalid wrote:
>
> Hi all,
>
> I'm not sure what is happening, but I defined some matrices:
> Mz = matrix([[0,1],[1,0]])
> Mx = matrix([[1,0],[0,-1]])
>
> M1 = matrix([[1,0],[0,1]])
>
> And then I tried defining a function where I
On Sat, Dec 1, 2018, 4:00 PM Nils Bruin On Saturday, December 1, 2018 at 3:36:55 PM UTC-8, Tevian Dray wrote:
>>
>> How can I create variable names programmatically, then assign values to
>> them?
>>
>> Python doesn't make that particularly easy, and it also doesn't make
> accessing variables
On Saturday, December 1, 2018 at 3:36:55 PM UTC-8, Tevian Dray wrote:
>
> How can I create variable names programmatically, then assign values to
> them?
>
> Python doesn't make that particularly easy, and it also doesn't make
accessing variables thus created particularly easy. I suspect the
>> Use the globals() Python dictionary.
Works perfectly; thanks!
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sage-support+unsubscr...@googlegroups.com.
To
Use the globals() Python dictionary.
E.g.,
$ python
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> globals()['q' + str(5)] = 15
>>> q5
15
On Sat, Dec 1, 2018 at 3:36 PM Tevian Dray wrote:
>
>
How can I create variable names programmatically, then assign values to
them?
I've tried creating variables with something like
var('q'+str(n))
but my attempts to assign a value to such a variable have been unsuccessful.
The underlying problem is that I do not know in advance how many
>
> See a similar report on the sage-cell mailing list:
> https://groups.google.com/d/topic/sage-cell/BL9h7xLiwG4/discussion
>
> In the discussion there, Andrey Novoseltsev points out
> that SageMathCell uses only one jsmol instance, and
> if there are several plots using it, they might