Hi everyone,
I have a program that requires some user inputs. I know raw_input([...])
can be used for string inputs and int(raw_input([...])) for integer inputs
but I also need a matrix input from users. Is there anyone who can help me
with this?
I thought of asking the user to input a list, for eg.
in program: g = raw_input(matrix input: ')
G = matrix(g)
sage: matrix input: [[2,2],[3,3]]
for the matrix [2 2]
[3 3]
but the raw_input function takes my input as a string, ie g =
"[[2,2],[3,3]]" hence cannot construct the matrix G...I know if those are
typed into the console, it will work...
sage: g = [[2,2],[3,3]]
sage: G = matrix(g)
sage: G
[2 2]
[3 3]
But the raw_input function will read it as a string "[[2,2],[3,3]]" and
will not work... Is there some easy way for user to input a matrix?....
Thanks in advance!
Eileen
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.