Ximo wrote: > I am doing my own interpreter with the Python languaje. > > Do you understand me? > > > > "Fredrik Lundh" <[EMAIL PROTECTED]> escribió en el mensaje > news:[EMAIL PROTECTED] > >>"Ximo" wrote: >> >> >>>I am doing a interpret of lines and it show me a prompt, and I want if I >>>write a declaration as "int a" my progrtam return de prompt and nothing >>>more, for exemple: >>> >>>
You may be looking for the flags argument to the compile function: >>> exec compile("int(3)","<console>","single") 3 >>> exec compile("int(3)","<console>","exec") >>> >>> help(compile) Help on built-in function compile in module __builtin__: compile(...) compile(source, filename, mode[, flags[, dont_inherit]]) -> code object Compile the source string (a Python module, statement or expression) into a code object that can be executed by the exec statement or eval(). The filename will be used for run-time error messages. The mode must be 'exec' to compile a module, 'single' to compile a single (interactive) statement, or 'eval' to compile an expression. The flags argument, if present, controls which future statements influence the compilation of the code. The dont_inherit argument, if non-zero, stops the compilation inheriting the effects of any future statements in effect in the code calling compile; if absent or zero these statements do influence the compilation, in addition to any features explicitly specified. >>> Michael -- http://mail.python.org/mailman/listinfo/python-list