ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 02 Apr 2013 12:42:35 +0200Convert a text file into a matrixhttps://ask.sagemath.org/question/9973/convert-a-text-file-into-a-matrix/I have a file with a list of elements inside the square of a Quadratic field, i.e. `QQ(sqrt[13])^2`. The file looks like `[[2 + sqrt[13],4 - 2*sqrt[13]],[2,sqrt[13]],...]`. I want to import this file into a single matrix over the field, in the previous example `F.<a> = QuadraticField(13)`. Currently, I read everything in as a string then convert to the matrix, but there must be an easier way to do this. I am somewhat new to python programming in general.jmcshan1Tue, 02 Apr 2013 12:42:35 +0200https://ask.sagemath.org/question/9973/