In CPython, the runtime will look for a .pyc file corresponding to any .py file
it's asked to access, and its contents are used if the .pyc file's timestamp is
later than that of the .py file. The .pyc file contents aren't native code,
but in theory things are (at least a little bit) faster whe
You can get the line number info by using Dino's code (calling
sys.exc_info). Are you concerned that the default traceback display
doesn't show the line number?
At 01:44 PM 8/21/2006, Matt Beckius wrote
No 32bit. I tried manually
setting the TraceBackSupport, but still got the same result:
Ir
Hi,
I have a C# app that I am trying to display some values from a Python
script.
A bit shorted here but when I click button1 I want to see the value of
varOne appear in
textBox2. Not sure if this is exactly the way to approach this or not.
public partial class Form1 : Form
{
private P
> File "", line 3, in test
> ValueError: invalid literal for int(): hi
>
>
>
>
>
> But IP RC2 produces:
>
>
>
> IronPython 1.0.60816 on .NET 2.0.50727.42
> Copyright (c) Microsoft Corporation. All rights reserved.
> >>> def test():
> ... pri
ror: invalid literal for int(): hi
>
>
>
>
>
> But IP RC2 produces:
>
>
>
> IronPython 1.0.60816 on .NET 2.0.50727.42
> Copyright (c) Microsoft Corporation. All rights reserved.
> >>> def test():
> ... print "hi"
> ... int("hi&
I think our generator performance is about on-par w/ CPython, so I don't
believe this is the issue (we actually did improve this somewhat during the
middle of the beta cycle when we did our perf push). But this test case:
import time
loops = 1000
def foo():
for i in range(loops): yield
This has moved to just being engine.Import("site") after you make sure you have
site on your path. Basically this has moved into the console code:
private static void ImportSite(PythonEngine engine) {
if (!ConsoleOptions.ImportSite)
return;
string
Yep, FormatException is the right API to call.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stanislas Pinte
Sent: Monday, August 21, 2006 9:21 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Code broken in RC2
by looking at IronPythonConsole
You should be able to do engine.Execute('print myVar2') and it should print out
the value you stored into Globals.
You can also create other modules that have different sets of globals and pass
the EngineModule to the overload of Execute that takes one of those.
-Original Message-
From:
Is this cold startup time, or warm startup time? On Windows I get:
F:\Product\IronPython\IronPython\Public>type foo.py
print 'hello'
F:\Product\IronPython\IronPython\Public>"C:\Program Files
(x86)\util\TimeIt.exe" "ipy.exe foo.py"
Running ipy.exe foo.py
elapsed time = 1282 milliseconds
this is
No 32bit. I tried manually setting the TraceBackSupport, but still got the same result:
IronPython 1.0.60816 on .NET 2.0.50727.42Copyright (c) Microsoft Corporation. All rights reserved.>>> import IronPython>> IronPython.Compiler.Options.TraceBackSupport = True
>>> def Test():... print "
by looking at IronPythonConsole sources, it seems it might be like:
private static void DefaultExceptionHandler(object sender,
UnhandledExceptionEventArgs args) {
MyConsole.WriteLine("Unhandled exception: ", Style.Error);
MyConsole.Write(engine.FormatException((Exception)args.Exceptio
hello,
could you please tell me what happened to engine.ImportSite();, and what
should I change in my code to get same behaviour?
thanks,
Stan.
--
-
Stanislas Pinte e-mail: [EMAIL PROTECTED]
ERTMS Solutions
Hello,
I was using the Console class to get a more or less clean dump of
exceptions in my embedded scripting engine:
DummyConsole dummy = new DummyConsole();
engine.MyConsole = dummy;
engine.DumpException(nested);
This code is now broken in IronPython RC2...any suggestions on how to
fix this?
T
Are you running on a 64-bit machine w/ a 64-bit runtime? By
default we disable trackback support on 64-bit machines (we’ve hit a unique bug
w/ exception handling there), but it is enabled on 32-bit machines and should
work there.
If I do:
import sys
def test2():
try: test()
Trying to get the line number of an error. CPython produces:
Python 2.4.2 (#67, Sep 28 2005, 12:41:11)Type "help", "copyright", "credits" or "li>>> def test():... print "hi"... int("hi")
...>>> test()hiTraceback (most recent call last): File "", line 1, in ? File "", line 3, in testVal
Hi All,
I just started using Iron Python and I am bit unsure on the best way to
pass data from the app that runs the script and the script itself.
So far I know that we should do something like this from say a C#
application,
PythonEngine.Globals["myVar"] = myVar;
So from the looks of this it is
Dino, Klaus,
just a small question: Could it be the coroutines (yield statement)
implementation in C# that would slow down the simpy simulation?
Thanks,
Stan.
Dino Viehland a écrit :
> Klaus,
>
> You're correct in that we didn't do a whole lot of performance tuning
> from the betas t
18 matches
Mail list logo