BisonGen parser generator. Newbie question
Hello everybody! I'm trying to run the calculator example included with the "BisonGen" parser generator, but I've been unable to put it to work. When I compile the xml file "simple.bgen" with the script "BisonGen.bat", the only parser I get is a C file. I've heard BisonGen generates also a python file, which is, I believe, the one used imported by "test.py" to run the testing. Does anybody know what I'm doing wrong here? Thank you in advance! -- http://mail.python.org/mailman/listinfo/python-list
Newbie Question
Hi everyone I'm sure this question is kinda stupid and has been answered a few times before... but I need your help! I'm writing a small application where the user can analyze some text based on a set of changing conditions , and right now I'm stuck on a point where I'd like to automatically generate new classes that operate based on those user-defined conditions. Is there a way in python to define a class in runtime? For instance, can I define a class which extends another(that I have previously defined in some module) , create some instance completely on the fly and then add/redefine methods to it? If affirmative, I've thought of a problem I would maybe have to face: as the class has been defined by direct input to the python interpreter, I could only create instances of it on the same session I entered the definition(because it's not on a module I can load on future uses) but not afterwards. Is there a way to keep that code? Even more newbie paranoia: what would happen if I make that 'on the fly" object persist via pickle? Where would Python find the code to handle it once unpickled on another session (once again, i take that no code with the definition of that instance would exist, as it was never stored on a module). Hope it wasn't too ridiculous an idea. Thank you for your time, guys. -- http://mail.python.org/mailman/listinfo/python-list
Newbie Question. Class definitions on the fly.
Hi everyone I'm sure this question is kinda stupid and has been answered a few times before... but I need your help! I'm writing a small application where the user can analyze some text based on a set of changing conditions , and right now I'm stuck on a point where I'd like to automatically generate new classes that operate based on those user-defined conditions. Is there a way in python to define a class in runtime? For instance, can I define a class which extends another(that I have previously defined in some module) , create some instance completely on the fly and then add/redefine methods to it? If affirmative, I've thought of a problem I would maybe have to face: as the class has been defined by direct input to the python interpreter, I could only create instances of it on the same session I entered the definition(because it's not on a module I can load on future uses) but not afterwards. Is there a way to keep that code? Even more newbie paranoia: what would happen if I make that 'on the fly" object persist via pickle? Where would Python find the code to handle it once unpickled on another session (once again, i take that no code with the definition of that instance would exist, as it was never stored on a module). Hope it wasn't too ridiculous an idea. Thank you for your time, guys. -- http://mail.python.org/mailman/listinfo/python-list
Strange problem when running python code
Hi everybody I've been writing my very first application in Python and everything is running smoothly, except for a strange problem that pops up every once in a while. I'm sure is the kind of newbie thing every seasoned programmer knows. Sometimes a receive strange Syntax Errors from parts of code that worked perfectly minutes ago. What's even more puzzling is that those errors are pointed to another part of the module when I do some random, innofensive changes in the code (like inserting a line or deleting some comments). Sometimes those changes are enough to make the error dissapear. Could it be that python has found a real error but is failing to tell me where it is? -- http://mail.python.org/mailman/listinfo/python-list
Re: Strange problem when running python code
I must add, when the python interpreter displays the traceback, with the line that is producing the error, it doesn't look like the one I got in the code. This is the line where the interpreter finds the error if text.list[i].toString() in limits:list)): <- Here is where the error is found, but this line is not on my file SyntaxError: invalid syntax And this is the line I got on the file, looks like the interpreter is mixing the second sentence with the end of the first one: for i in range(self.initialPositionl+1,len(text.list)): if text.list[i].toString() in limits: self.finalPosition=i break It's quite puzzling. And if I change some lousy thing, like inserting a newline between the sentences, the interpreter will find another error somewhere else, even when that part of the code was working flawlessly in previous runs -- http://mail.python.org/mailman/listinfo/python-list
How to create a tear off menu in TKinter. Help Needed
Hi everybody I'd appreciate some help on creating a tear off menu with TkInter. I've been reading some documentation but still no luck. Please don't get confused: when I mean "tear off" menu I don't mean a drop-down or a pop-up menu, but those options which yield to another batch of sub-options when scrolled over, (as for example, the File->New option from internet explorer). I'm sure TkInter supports those widgets because the IDLE editor is built on it and it's got some tear off options like File->Recent Files. Thank you all in advance -- http://mail.python.org/mailman/listinfo/python-list