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():
im
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 ex
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 {
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 at
: 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 'fak
> On Sun Aug 05, 2007; 12: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
.ParseFileInput();
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
I found the problem. the 'from' section should not contain the
subclass name
On Aug 4, 1:54 pm, Ori <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have a public subclass in an assembly I reference. I want to create a new
> python class which inherits from the subcalss.
>
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 = Ops.Call
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
context is
the inherited 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.
__
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
or");
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 PROTEC
> The Parser class is IronPython.Compiler.Parser, 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
CompilerSink object. Your 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
> call that from C# and get the result back.
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Ori
> Sent: Thursday, August 02, 2007 10:53 PM
> To: users@lists.ironpython.com
> Subject: [IronPython] Declare a class in Python
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,
Or
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
save 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 IronPyth
19 matches
Mail list logo