Getting Variables from a file
Curtis Jensen
cjensen at bioeng.ucsd.edu
Sat May 27 19:34:28 EDT 2000
I have a text file of the form:
(var = integer)
dof = 8
elements = 10
mesh_dof = 300
.
.
.
.
I want to read the file from within Python and then create a variable in
python of the same name as what is in the text file, and holding the
assigned value. Assuming I don't already know the names of the
varialbes; how do I do this? I can do the file I/O, but how do I change
a character string into a variable name? Thanks.
--
Curtis Jensen
cjensen at bioeng.ucsd.edu
http://www-bioeng.ucsd.edu/~cjensen/
FAX (425) 740-1451
More information about the Python-list
mailing list