As I assume the text you want to process has some source you might want 
to look at <a href="http://docs.python.org/library/pickle.html">http://docs.python.org/library/pickle.html</a> ...<br><br><div class="gmail_quote">2012/1/24 T H <span dir="ltr"><<a href="mailto:turian9000@gmail.com">turian9000@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I’m new to python, sorry if my question is a bit naive, I was<br>
wondering if it is possible to parse some text (ie. from a text file<br>
or say html) and then dynamically create a class?<br>
<br>
for example lets say the contents of the text file is:<br>
<br>
     functionName: bark  arg1: numberBarks<br>
     functionName: run    arg1: howFast  arg2: howLong<br>
<br>
and then from the text dynamically create a class like the one below<br>
(including the functions and its implementation)<br>
<br>
class Dog:<br>
        def bark(self, numberBarks, myArg):<br>
                print(‘numberBarks: ‘ + numberBarks)<br>
                print(‘myArg’ + myArg)<br>
                return<br>
        def run(self, howFast, howLong, myArg):<br>
                print(‘howFast: ‘ + howFast)<br>
                print(‘howLong’ + howLong)<br>
                print(‘myArg’ + myArg)<br>
                return<br>
<br>
I know my question is a bit far fetched. Anyhow if it is possible how<br>
is it done?<br>
Thanks so much for any help!<br>
<span class="HOEnZb"><font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><font size="1">PGP pub key: <br>
           <a href="http://keyserver.pgp.com/vkd/SubmitSearch.event?SearchCriteria=visgean%40gmail.com" target="_blank">http://keyserver.pgp.com/vkd/SubmitSearch.event?SearchCriteria=visgean%40gmail.com</a><br>
           <a href="http://www.abclinuxu.cz/lide/visgean/gpg" target="_blank">http://www.abclinuxu.cz/lide/visgean/gpg</a><br>           A453 B7F3 33D9 3BE6 2B8A | F014 5347 EBAC 0A5A 3E92<br>Jabber: </font><font size="1"><a href="mailto:visgean@jabber.org" target="_blank">visgean@jabber.org</a> <font>|</font> <a href="mailto:visgean@jabber.cz" target="_blank">visgean@jabber.cz</a><br>
Github: </font><font size="1"><a href="http://github.com/Visgean" target="_blank">http://github.com/Visgean</a></font><br><br>