Hi,
I'm porting Testoob to IronPython and have a module function that needs to
know the filename where the code calling it is defined.
In CPython I get the current frame with sys._getframe(), then climb
the stack with frame.f_back until I find a different file:
def _first_external_frame():
Hello,
Is there a way to use code blocks (like { and } in other languages) instead
of indentation?
Thanks,
Ori
--
View this message in context:
http://www.nabble.com/Using-blocks-separators-instead-of-indentation-tf4259431.html#a12121490
Sent from the IronPython mailing list archive
OK I got the point. I have to use several statements in a single line.
For exmpale, something like:
i = 1; if (i =1): i = 0
is there a way to do it? Is there a replacement to the newline char?
Thanks.
Ori wrote:
Hello,
Is there a way to use code blocks (like { and } in other
Thanks but I did not ask if it is ugly or not. I just need it.
Is there a way to do it?
Curt Hagenlocher wrote:
On 8/13/07, Ori [EMAIL PROTECTED] wrote:
OK I got the point. I have to use several statements in a single line.
For exmpale, something like:
i = 1; if (i =1): i = 0
();
it works find for finding syntax mistakes - but I also wan to know about
invalid property names / method names. If for example the code uses the
expression 'self.Name' I would like to see a compilation error if the object
does not have a 'Name' property.
Is there a way to do it?
Thanks,
Ori
:51PM -0700, Ori wrote:
Hello,
I'm using the following code to compile python code:
SystemState state = new SystemState();
MyCompilerSink sink = new MyCompilerSink();
CompilerContext context = new CompilerContext(string.Empty, sink);
Parser parser = Parser.FromString(state, context, my
To: Discussion of IronPython
Subject: Re: [IronPython] Compiler error for invalid field access
Ori wrote:
Executing the code to know if there is a problem or not is not what I wish
for. I really can't do it because in my case the context does not exist.
I will try to create a 'fake' context in order
to do it?
Thanks,
Ori
--
View this message in context:
http://www.nabble.com/Inheritance-from-a-c--subclass-tf4216398.html#a11995601
Sent from the IronPython mailing list archive at Nabble.com.
___
Users mailing list
Users@lists.ironpython.com
http
class. Is there a way to avoid this prefix?
Thanks,
Ori
--
View this message in context:
http://www.nabble.com/avoiding-using-the-keyword-%27self%27-tf4216418.html#a11995646
Sent from the IronPython mailing list archive at Nabble.com.
___
Users
I guess the answer is no, and I must explicitly use the 'self.' prefix. About
the syntax error - you are right, there is one in the post, but it has
nothing to do with ineriting from a sub-class
Ori wrote:
Hello,
I have a python class which inherits from some other (c#) class. Something
you can try the following code:
PythonEngine engine = new PythonEngine();
EngineModule module = engine.CreateModule();
engine.Execute(handleCode(code, def), module); # code contains definition
for python class 'PyClass'
UserType ptype = module.Globals[PyClass] as UserType;
object obj =
Hello,
I'm using PythonEngine.Compile to compile code. The code I compile may
contain errors and that's why I want to format the error(s). Currently I'm
using try-catch and I work with the exception error text. Is there a btter
way to get the compilation errors?
Thanks,
Ori
--
View
CompilerSink object will get called
back w/ the errors.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ori
Sent: Thursday, August 02, 2007 11:42 PM
To: users@lists.ironpython.com
Subject: [IronPython] Find the compile erros
Hello,
I'm using
, the CompilerContext is
IronPython.Compiler.CompilerContext, and the CompilerSink which you need
to derive from and override AddError is IronPython.Hosting.CompilerSink.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ori
Sent: Friday, August 03
);
but the AddError method was not called.
Dino Viehland wrote:
The FromFile and FromString methods are public static methods on the
Parser class that create the Parser object.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ori
Sent: Friday, August 03
Hello,
I have a .net class (in some assembly). I want to inherit from it and
override a function in it - with python code. I'm using c# to compile the
python code, and after the compilation is done I want to create an instance
of the new class inside c#.
Is there a way to do it?
Thanks,
Ori
compiled code in memory and use it to evaluate code multiple
times? I've seen there is a CompiledCode object but I saw only an Execute
method.
Thanks,
Ori
--
View this message in context:
http://www.nabble.com/Some-questions-about-Iron-Python-tf4198487.html#a11940989
Sent from the IronPython mailing
17 matches
Mail list logo