[IronPython] problem with embedding ironpython in browser with silverlight

2010-07-09 Thread
hello everyone: i am new to ironpython i get the agdlr-0.5.0 package and try to run it in sliverlight 4.0, ironpython 2.6 seems to work on c# CLR, cos' when i try to add the dll's references to my silverlight assembly visual studio tells that they are not build under silverlight

[IronPython] Crippled Intellisense?

2010-07-09 Thread Marcin Krol
I got an MSDN license which allowed me to install VS 2010 Professional, I also installed IronPython tools. However, intellisense doesn't seem to fully work, for instance I can access string method's like 'abc'.(complete) but when I do x = 'abc' and then x. it just underscores it in red.

[IronPython] Compiling so that IronPython libraries are recognized?

2010-07-09 Thread Funke, Matt
I'm extremely new to compiling things in anything approaching a pythonic way, so my apologies in advance for what's probably a very simplistic question. I've downloaded the source for psycopg2-2.2.1. The documentation recommends using the standard python setup.py build and python setup.py

[IronPython] Writing to a file with unicode name

2010-07-09 Thread abdalla ramadan
Hello, I am trying to write to a file with the japanese name 青山学院大学相模原キャンパス The relative path I am passing to the methods is output\url\c\青山学院大学相模原キャンパス I used two methods s = StreamWriter(filenamenew, True, Encoding.UTF8) and outputfile = codecs.open(filenamenew, w,'utf_8_sig') which both

[IronPython] System.MissingMemberException

2010-07-09 Thread Marcin Krol
Hello everyone, I have stumbled upon what's probably an idiotic newbie problem: if I add any method to a class, I get System.MissingMemberException. E.g. import clr clr.AddReference('System.Windows.Forms') from System.Windows.Forms import * class MyForm(Form): def __init__(self):

[IronPython] System.MissingMemberException

2010-07-09 Thread Marcin Krol
Hello everyone, Ok I found the cause, the __init__ filled in from the template is exactly one space to the left from where it should be: class MyForm(Form): def __init__(self): ... def func(self, x): return x If I shift def __init__.. one space to the right, everything

[IronPython] Crippled Intellisense?

2010-07-09 Thread Marcin Krol
Now that I got tabs right, intellisense works too. -- Regards, mk -- Premature optimization is the root of all fun. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: [IronPython] Compiling so that IronPython libraries are recognized?

2010-07-09 Thread Michael Foord
On 09/07/2010 14:50, Funke, Matt wrote: I'm extremely new to compiling things in anything approaching a pythonic way, so my apologies in advance for what's probably a very simplistic question. I've downloaded the source for psycopg2-2.2.1. The documentation recommends using the standard

Re: [IronPython] Compiling so that IronPython libraries are recognized?

2010-07-09 Thread Jeff Hardy
On Fri, Jul 9, 2010 at 8:49 AM, Michael Foord fuzzy...@voidspace.org.uk wrote: subprocess relies on modules like signal that aren't available in IronPython 2.6.1. http://bitbucket.org/jdhardy/code/src/tip/subprocess.py There is a partial implementation of subprocess by Jeff Hardy floating

Re: [IronPython] Foolproof IP Embedding

2010-07-09 Thread Alex
2010/7/8 Michael Foord fuzzy...@voidspace.org.uk On 08/07/2010 22:34, Alex wrote: Hello In my WPF application, I want to have an expert mode that lets the end-user write inline python code targetting one specific control (a sheetmusic). I embed IronPython and when the user code throws an

Re: [IronPython] Compiling so that IronPython libraries are recognized?

2010-07-09 Thread Vernon Cole
There IS a working dbapi 2.0 implementation for Iron Python. see http://sourceforge.net/projects/adodbapi It uses Microsoft ADO, so should be able to connect with PostgreSQL or almost any other tabular data source. I have not yet tested it with Postgres. That's the next thing on my to-do list. (I

Re: [IronPython] Compiling so that IronPython libraries are recognized?

2010-07-09 Thread Funke, Matt
I'm beginning to think that something is seriously wrong with my installation of IronPython. When I enter IronPython from the command line (by typing ipy -D -X:ColorfulConsole -X:TabCompletion), and type in help('modules') to start my investigation of the dbapi implementation, I get this

[IronPython] overriding methods from C# classes

2010-07-09 Thread Marcin Krol
Hello Michael and everyone, Michael Foord wrote: I recommend using the Visual Studio C# designer and then subclass the classes it generates from IronPython. I set out to do just that and stumbled upon a problem: I generated Windows form in C#, compiled into assembly (ip_cl1), copied to

[IronPython] Unable to find assembly 'Microsoft.Dynamic

2010-07-09 Thread Marcin Krol
Hello everyone, I seem to be hitting all the rough edges: when I run my project in interactive window (Debug | Execute project in python interactive..), I get this exception: Remote process has been reset... Exception: System.Runtime.Serialization.SerializationException: Unable to find

[IronPython] overriding methods defined in C# classes

2010-07-09 Thread Marcin Krol
Hello Michael and everyone, (sigh, I sent reply recently while I meant to start a new thread, this is it) Michael Foord wrote: I recommend using the Visual Studio C# designer and then subclass the classes it generates from IronPython. I set out to do just that and stumbled upon a problem:

Re: [IronPython] Writing to a file with unicode name

2010-07-09 Thread Vernon Cole
Adballa: One problem you may be having is with Python trying to escape the backslashes in your Windows file name. I tried a very simple test using the Python open statement rather than any fancy .NET things. It created a file with a japenese name on my Windows Vista laptop. Note that I used

Re: [IronPython] overriding methods defined in C# classes

2010-07-09 Thread Simon Dahlbacka
Shouldn't your c# methods be protected virtual to be overridable? On Jul 9, 2010 7:41 PM, Marcin Krol mrk...@gmail.com wrote: Hello Michael and everyone, (sigh, I sent reply recently while I meant to start a new thread, this is it) Michael Foord wrote: I recommend using the Visual Studio C#

Re: [IronPython] System.MissingMemberException

2010-07-09 Thread Dino Viehland
Marcin wrote: Hello everyone, Ok I found the cause, the __init__ filled in from the template is exactly one space to the left from where it should be: class MyForm(Form): def __init__(self): ... def func(self, x): return x If I shift def __init__.. one space

Re: [IronPython] System.MissingMemberException

2010-07-09 Thread Dino Viehland
Marcin wrote: Hello everyone, I have stumbled upon what's probably an idiotic newbie problem: if I add any method to a class, I get System.MissingMemberException. E.g. import clr clr.AddReference('System.Windows.Forms') from System.Windows.Forms import * class MyForm(Form):

Re: [IronPython] Tracebacks

2010-07-09 Thread Dino Viehland
Rob wrote: Hi This might be the wrong list for this, but when I run python apps in an ide (like wing) I get nice exception tracebacks with line numbers, yet in visualstudio with ironpython tools these are missing, instead I get a dialog that isn't very useful unless I copy the details to

Re: [IronPython] sys._getframe(0).f_lineno always returns 1

2010-07-09 Thread Dino Viehland
This is definitely a bug. If you'd open a bug on CodePlex that'd be great. Currently we only track the line information locally but in -X:Frames mode we should hoist that information into the frame. From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] On

Re: [IronPython] Unable to find assembly 'Microsoft.Dynamic

2010-07-09 Thread Dino Viehland
Can you bring the interactive window up normally using Alt-I or View-Other Windows-IronPython Interactive? -Original Message- From: users-boun...@lists.ironpython.com [mailto:users- boun...@lists.ironpython.com] On Behalf Of Marcin Krol Sent: Friday, July 09, 2010 9:24 AM To:

Re: [IronPython] overriding methods defined in C# classes

2010-07-09 Thread Marcin Krol
Simon Dahlbacka wrote: Shouldn't your c# methods be protected virtual to be overridable? Yes, that was it. Thanks! I'm a total newbie in C#. -- Regards, mk -- Premature optimization is the root of all fun. ___ Users mailing list

Re: [IronPython] overriding methods from C# classes

2010-07-09 Thread Dino Viehland
Marcin wrote: Hello Michael and everyone, Michael Foord wrote: I recommend using the Visual Studio C# designer and then subclass the classes it generates from IronPython. I set out to do just that and stumbled upon a problem: I generated Windows form in C#, compiled into assembly

Re: [IronPython] System.MissingMemberException

2010-07-09 Thread Marcin Krol
Dino Viehland wrote: We do have an option to report inconsistent tabs/spaces... We just need to enable it in the parser and setup an option to disable it. I believe it's somewhere on the TODO list. Good to know -- inconsistent indentation can be a real pain in a large project. WingIDE does

Re: [IronPython] overriding methods from C# classes

2010-07-09 Thread Marcin Krol
Dino Viehland wrote: Is there some way of simply overriding methods in Python so that they do get called by form events? In both of these cases there are no methods to be overridden. You're just defining methods which you want to use for the event handlers. You need to connect those methods

Re: [IronPython] overriding methods from C# classes

2010-07-09 Thread Curt Hagenlocher
On Fri, Jul 9, 2010 at 10:43 AM, Marcin Krol mrk...@gmail.com wrote: Bc when I changed declaration of the method to protected virtual in the Form1.cs, the inherited class calls my Ipython method all right - that looks like overriding to me, at least when looking at it from the outside and not

Re: [IronPython] Writing to a file with unicode name

2010-07-09 Thread abdalla ramadan
Vernon: Thank you very much for your reply. Since the unicode text is not hard coded and is read from file I thought that writing line = line[0:-1] will get rid of the new line character but it seemed I have to write line = line.replace(\r,).replace(\n,) now the code works correctly. Thanks

Re: [IronPython] Compiling so that IronPython libraries are recognized?

2010-07-09 Thread Funke, Matt
IRONPYTHONPATH is not even an environment variable. README.txt is the only file in %PROGRAMFILES%\IronPython 2.6 for .NET 4.0\Lib\site-packages. Changing line 242 of site.py in C:\Users\me\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools for Visual

Re: [IronPython] overriding methods from C# classes

2010-07-09 Thread Dino Viehland
Marcin wrote: Dino Viehland wrote: Is there some way of simply overriding methods in Python so that they do get called by form events? In both of these cases there are no methods to be overridden. You're just defining methods which you want to use for the event handlers. You need to

Re: [IronPython] Unable to find assembly 'Microsoft.Dynamic

2010-07-09 Thread Marcin Krol
Dino Viehland wrote: Can you bring the interactive window up normally using Alt-I or View-Other Windows-IronPython Interactive? Sure -- you mean that I run the program via execfile()? Here's result, it's an exception but different one this time: » execfile('Program.py') Traceback (most

Re: [IronPython] overriding methods from C# classes

2010-07-09 Thread Marcin Krol
Thanks for replies, Dino! Dino Viehland wrote: 1. when IPY 2.7 is to be released? Our current plan is around the end of this year. That's a pity, I need to get rolling with this relatively soon. 2. Documentation. This sort of worries me: where do I get the detailed info how to use this

[IronPython] JSON vs. IronPython

2010-07-09 Thread Marcin Krol
Hello everyone, I have successfully used JSON as serialization protocol between various clients and servers in 2 projects, incl. Java app talking to Python servers, so I would like to use JSON in my upcoming C/S project as well: there's Json.NET, but how viable is using it in IronPython?

Re: [IronPython] overriding methods from C# classes

2010-07-09 Thread Marcin Krol
Curt Hagenlocher wrote: Yes. It's universally true in the CLR that you can't override a function in a derived class unless the function was marked as virtual in the base class. IronPython is no different than C# in this regard. One thing that would be *nice* for C# noobs like me would be

Re: [IronPython] JSON vs. IronPython

2010-07-09 Thread Brian Curtin
On Fri, Jul 9, 2010 at 13:05, Marcin Krol mrk...@gmail.com wrote: Hello everyone, I have successfully used JSON as serialization protocol between various clients and servers in 2 projects, incl. Java app talking to Python servers, so I would like to use JSON in my upcoming C/S project as

Re: [IronPython] Compiling so that IronPython libraries are recognized?

2010-07-09 Thread Funke, Matt
I found the source of the error. C:\Documents and Settings is a protected folder in Windows 7. You need to change the security permissions on it so that IronPython has permission to view its contents and read files from it. First, I needed to be sure I could view all files and folders (one

[IronPython] reading utf-8 files

2010-07-09 Thread abdalla ramadan
Hello, I am trying to read utf-8 files (written using notepad and have BOM) using the following code file = codecs.open(dir+ '\\' + i,r,'utf_8_sig') for line in file: print line I attached two files the a - 3 lines.txt file gives this exception and print line is never called not even once

Re: [IronPython] overriding methods from C# classes

2010-07-09 Thread Lukas Cenovsky
On 9.7.2010 19:17, Dino Viehland wrote: This is one of the reasons why I suggest WPF over WinForms. In WPF you can declare the event handlers in the XAML and we can wire them up to you. In our IronPython 2.7 source code I recently added a clr.LoadComponent method which does this. So for WPF

Re: [IronPython] Unable to find assembly 'Microsoft.Dynamic

2010-07-09 Thread Dino Viehland
Marcin wrote: Dino Viehland wrote: Can you bring the interactive window up normally using Alt-I or View-Other Windows-IronPython Interactive? Sure -- you mean that I run the program via execfile()? Here's result, it's an exception but different one this time:

Re: [IronPython] overriding methods from C# classes

2010-07-09 Thread Dino Viehland
Marcin wrote: Curt Hagenlocher wrote: Yes. It's universally true in the CLR that you can't override a function in a derived class unless the function was marked as virtual in the base class. IronPython is no different than C# in this regard. One thing that would be *nice* for C# noobs

Re: [IronPython] JSON vs. IronPython

2010-07-09 Thread Tristan Zajonc
There are bugs in the IronPython 2.6.1 json implementation that I believe have been reported and will be fixed in 2.6.2. For instance, the following gives me an exception: json.loads(json.dumps(dict(test=test))) I have had better luck with simplejson and import simplejson as json Tristan On

Re: [IronPython] using XAML in IronPython

2010-07-09 Thread Michael Foord
On 09/07/2010 23:14, Andrew Evans wrote: Hello I am learning IronPython having come from a CPython background, I started learning C# to add more to my knowledge base for IronPython. I have a few questions using XAML: First if I build something using the xaml designer in IronPython Studio

Re: [IronPython] using XAML in IronPython

2010-07-09 Thread Dino Viehland
The next release of Ipy Tools (and IronPython 2.7) will greatly simplify this. You'll be able to call clr.LoadComponent and point at your XAML file and your Window subclass. It'll then automatically add all of the x:Name (and Name'd) elements onto your Window subclass so you can just do

Re: [IronPython] using XAML in IronPython

2010-07-09 Thread Andrew Evans
Sounds great when is the expected release date for that :D On Fri, Jul 9, 2010 at 3:28 PM, Dino Viehland di...@microsoft.com wrote: The next release of Ipy Tools (and IronPython 2.7) will greatly simplify this. You’ll be able to call clr.LoadComponent and point at your XAML file and your

Re: [IronPython] using XAML in IronPython

2010-07-09 Thread Dino Viehland
It should be sometime this month. From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] On Behalf Of Andrew Evans Sent: Friday, July 09, 2010 3:37 PM To: Discussion of IronPython Subject: Re: [IronPython] using XAML in IronPython Sounds great when is the expected