Search Results

Search found 252 results on 11 pages for 'ironpython'.

Page 2/11 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11  | Next Page >

  • Ironpython - Named parameters to constructor

    - by yodaj007
    When I create an instance of my C# class in IronPython with named parameters to the constructor, it is setting properties corresponding to the names of the parameters. I wish to disable this behavior so I can have better control on the order the properties are evaluated. Is this possible?

    Read the article

  • Referencing web project from ironpython

    - by pedlar
    i've got an mvc project written in C#. i'm trying to reference it from ironpython. i've got no issue importing the objects and referencing the dll, but some of the objects rely on connection strings from the web.config, is there any way for me to reference the dll and then specify the web.config it should be using?

    Read the article

  • selecting dropdownlist item in IronPython

    - by Meli
    I want to select a particular item in a dropdownlist by value, in asp.net using IronPython. I found I can do it like this listItem = ddl.Items.FindByValue(x) if listItem != None: listItem.Selected = True But I want to do it in one line

    Read the article

  • Creating a structure from bytes with ctypes and IronPython

    - by Adal
    I have the following CPython code which I now try to run in IronPython: import ctypes class BarHeader(ctypes.Structure): _fields_ = [ ("id", ctypes.c_char * 4), ("version", ctypes.c_uint32)] bar_file = open("data.bar", "rb") header_raw = bar_file.read(ctypes.sizeof(BarHeader)) header = BarHeader.from_buffer_copy(header_raw) The last line raises this exception: TypeError: expected array, got str I tried BarHeader.from_buffer_copy(bytes(header_raw)) instead of the above, but then the exception message changes to TypeError: expected array, got bytes. Any idea what I'm doing wrong?

    Read the article

  • IronPython overriding __setattr__ and __getattr__

    - by yodaj007
    I'm trying to implement a class in C# with a method that intercepts the Python __setattr__ and __getattr__ magic methods. I found this bug report: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=8143 But that is from 2008, and nowhere can I find ICustomAttributes or PythonNameAttribute. I don't see anything useful in Interfaces.cs either. Can someone point me in the right direction?

    Read the article

  • Ironpython call numpy problem

    - by Begtostudy
    Ironpython 2.6, python 2.6.5, numpy, SciPy import sys sys.path.append(r'D:\Python26\dll') sys.path.append(r'D:\Python26\Lib') sys.path.append(r'D:\Python26\Lib\site-packages') » import numpy Traceback (most recent call last): File "<string>", line 1, in <module> File "D:\Python26\Lib\site-packages\numpy\__init__.py", line 132, in <module> File "D:\Python26\Lib\site-packages\numpy\add_newdocs.py", line 9, in <module> File "D:\Python26\Lib\site-packages\numpy\lib\__init__.py", line 4, in <module> File "D:\Python26\Lib\site-packages\numpy\lib\type_check.py", line 8, in <module> File "D:\Python26\Lib\site-packages\numpy\core\__init__.py", line 5, in <module> ImportError: No module named multiarray What's wrong? Thanks.

    Read the article

  • Linking IronPython to WPF

    - by DonnyD
    I just installed VS2010 and the great new IronPython Tools extension. Currently this extension doesn't yet generate event handlers in code upon double-clicking wpf visual controls. Is there anyone that can provide or point me to an example as to how to code wpf event handlers manually in python. I've had no luck finding any and I am new to visual studio. Upon generating a new ipython wpf project the auto-generated code is: import clr clr.AddReference('PresentationFramework') from System.Windows.Markup import XamlReader from System.Windows import Application from System.IO import FileStream, FileMode app = Application() app.Run(XamlReader.Load(FileStream('WpfApplication7.xaml', FileMode.Open))) and the XAML is: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="WpfApplication7" Height="300" Width="300"> <Button>Click Me</Button> </Window> Any help would be appreciated.

    Read the article

  • IronPython For Unit Testing over C#

    - by Krish
    We know that Python provides a lot of productivity over any compiled languages. We have programming in C# & need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the original code. Is it ideal choice to write unit test cases in IronPython instead of C#? Any body has done like that? I wrote few test cases, they seems to be good. But hairy pointy managers won't accept.

    Read the article

  • Using ManagementClass.Getinstances() from IronPython

    - by Leo Bontemps
    I have an IronPython script that looks for current running processes using WMI. The code looks like this: import clr clr.AddReference('System.Management') from System.Management import ManagementClass from System import Array mc = ManagementClass('Win32_Processes') procs = mc.GetInstances() That last line where I call the GetInstances() method raises the following error: Traceback (most recent call first): File "<stdin>", line 1, in <module> SystemError: Not Found I am not understanding what's not being found?!? I believe that I may need to pass an instance of ManagementOperationObserver and of EnumerationOptions to GetInstance() however, I don't understand why that is, since the method with the signature Getinstance() is available in ManagementClass.

    Read the article

  • IronPython and Nodebox in C#

    - by proxylittle
    My plan: I'm trying to setup my C# project to communicate with Nodebox to call a certain function which populates a graph and draws it in a new window. Current situation: [fixed... see Update2] I have already included all python-modules needed, but im still getting a Library 'GL' not found it seems that the pyglet module needs a reference to GL/gl.h, but can't find it due to IronPython behaviour. Requirement: The project needs to stay as small as possible without installing new packages. Thats why i have copied all my modules into the project-folder and would like to keep it that or a similar way. My question: Is there a certain workaround for my problem or a fix for the library-folder missmatch. Have read some articles about Tao-Opengl and OpenTK but can't find a good solution. Update1: Updated my sourcecode with a small pyglet window-rendering example. Problem is in pyglet and referenced c-Objects. How do i include them in my c# project to be called? No idea so far... experimenting alittle now. Keeping you updated. SampleCode C#: ScriptRuntimeSetup setup = Python.CreateRuntimeSetup(null); ScriptRuntime runtime = new ScriptRuntime(setup); ScriptEngine engine = Python.GetEngine(runtime); ScriptSource source = engine.CreateScriptSourceFromFile("test.py"); ScriptScope scope = engine.CreateScope(); source.Execute(scope); SampleCode Python (test.py): from nodebox.graphics import * from nodebox.graphics.physics import Vector, Boid, Flock, Obstacle flock = Flock(50, x=-50, y=-50, width=700, height=400) flock.sight(80) def draw(canvas): canvas.clear() flock.update(separation=0.4, cohesion=0.6, alignment=0.1, teleport=True) for boid in flock: push() translate(boid.x, boid.y) scale(0.5 + boid.depth) rotate(boid.heading) arrow(0, 0, 15) pop() canvas.size = 600, 300 def main(canvas): canvas.run(draw) Update2: Line 139 [pyglet/lib.py] sys.platform is not win32... there was the error. Fixed it by just using the line: from pyglet.gl.lib_wgl import link_GL, link_GLU, link_WGL Now the following Error: 'module' object has no attribute '_getframe' Kind of a pain to fix it. Updating with results... Update3: Fixed by adding following line right after first line in C#-Code: setup.Options["Frames"] = true; Current Problem: No module named unicodedata, but in Python26/DLLs is only a *.pyd file`. So.. how do i implement it now?!

    Read the article

  • How are you using IronPython?

    - by Will Dean
    I'm keen to drink some modern dynamic language koolaid, so I've believed all the stuff on Michael Foord's blog and podcasts, I've bought his book (and read some of it), and I added an embedded IPy runtime to a large existing app a year or so ago (though that was for someone else and I didn't really use it myself). Now I need to do some fairly simple code generation stuff, where I'm going to call a few methods on a few .net objects (custom, C#-authored objects), create a few strings, write some files, etc. The experience of trying this leaves me feeling like the little boy who thinks he's the only one who can see that The Emperor has no clothes on. If you're using IronPython, I'd really appreciate knowing how you deal with the following aspects of it: Code editing - do you use the .NET framework without Intellisense? Refactoring - I know a load of 'refactoring' is about working around language-related busywork, so if Python is sufficiently lightweight then we won't need that, But things like renames seem to me to be essential to iteratively developing quality code regardless of language. Crippling startup time - One of the things which is supposed to be good about interpreted languages is the lack of compile time leading to fast interactive development. Unfortunately I can compile a C# application and launch it quicker than IPy can start up. Interactive hacking - the IPy console/repl is supposed to be good for this, but I haven't found a good way to take the code you've interactively arrived at and persist it into a file - cut and paste from the console is fairly miserable. And the console seems to hold references to .NET assemblies you've imported, so you have to quit it and restart it if you're working on the C# stuff as well. Hacking on C# in something like LinqPad seems a much faster and easier way to try things out (and has proper Intellisense). Do you use the console? Debugging - what's the story here? I know someone on the IPy team is working on a command-line hobby-project, but let's just say I'm not immediately attracted to a command line debugger. I don't really need a debugger from little Python scripts, but I would if I were to use IPy for scripting unit tests, for example. Unit testing - I can see that dynamic languages could be great for this, but is there any IDE test-runner integration (like for Resharper, etc). The Foord book has a chapter about this, which I'll admit I have not yet read properly, but it does seem to involve driving a console-mode test-runner from the command prompt, which feels to be an enormous step back from using an integrated test runner like TestDriven.net or Resharper. I really want to believe in this stuff, so I am still working on the assumption that I've missed something. I would really like to know how other people are dealing with IPy, particularly if they're doing it in a way which doesn't feel like we've just lost 15 years'-worth of tool development.

    Read the article

  • Is it possible to use P4Python API with IronPython?

    - by nardbard
    Is it possible to use P4Python (the perforce python api) with IronPython? I'd like to use the python api because it seems much faster than using p4.net implementionat of a Perforce API but when I try to import p4 into IronPython I receive the following error. IronPython 2.6.1 (2.6.10920.0) on .NET 4.0.30128.1 Type "help", "copyright", "credits" or "license" for more information. import P4 Traceback (most recent call last): File "", line 1, in File "C:\Program Files\IronPython 2.6 for .NET 4.0\lib\site-packages\P4.py", l ine 210, in ImportError: No module named P4API

    Read the article

  • IronPython memory leak?

    - by Mike Gates
    Run this: for i in range(1000000000): a = [] It looks like the list objects being created never get marked for garbage collection. From a memory profiler, it looks like the interpreter's stack frame is holding onto all the list objects, so GC can never do anything about it. Is this by design?

    Read the article

  • Silverlight: IronPython in the browser Part 2

    This article is an excerpt taken from IronPython in Action, by Michael J. Foord and Christian Muirhead and published by Manning Publications. In the article the authors discuss how to take advantage of the exciting Silverlight platform with IronPython.

    Read the article

  • Silverlight: IronPython in the browser Part 1

    This article is an excerpt taken from IronPython in Action, by Michael J. Foord and Christian Muirhead and published by Manning Publications. In the article the authors discuss how to take advantage of the exciting Silverlight platform with IronPython.

    Read the article

  • IronPython 2.6.1 for .NET 4.0 RC targeting Silverlight?

    - by Fastidious
    Since the 2.6.1 .NET 4.0 RC release of IronPython (found @ http://ironpython.codeplex.com/releases/view/40146) does not include Silverlight binaries I am wondering if anyone has had any success getting it working themselves. I'd assume it would not be too hard to recompile the source against Silverlight but I can't seem to locate it on Codeplex. EDIT: Per the IronPython team, Silverlight 4 is not yet a stable release so no fully compatible binaries have been released.

    Read the article

  • How to install an additional .NET library?

    - by Deusdies
    I'm a beginner .NET programmer (C# and IronPython). I've come across WatiN .NET library which will show handy for what I'm trying to do. The website claims that it is compatible with any .NET language, so I assume it's compatible with IronPython as well. How do I go about installing it? Their website only has some instructions, using NUget in Visual Studio. I neither use Visual Studio nor am I interested in it. How and where would I put the downloaded files in order to make it work with IronPython?

    Read the article

  • How to pass an IronPython instance method to a (C#) function parameter of type `Func<Foo>`

    - by Daren Thomas
    I am trying to assign an IronPython instance method to a C# Func<Foo> parameter. In C# I would have a method like: public class CSharpClass { public void DoSomething(Func<Foo> something) { var foo = something() } } And call it from IronPython like this: class IronPythonClass: def foobar(): return Foo() CSharpClass().DoSomething(foobar) But I'm getting the following error: TypeError: expected Func[Foo], got instancemethod

    Read the article

  • How to handle value types when embedding IronPython in C#?

    - by kloffy
    There is a well known issue when it comes to using .NET value types in IronPython. This has recently caused me a headache when trying to use Python as an embedded scripting language in C#. The problem can be summed up as follows: Given a C# struct such as: struct Vector { public float x; public float y; } And a C# class such as: class Object { public Vector position; } The following will happen in IronPython: obj = Object() print obj.position.x # prints ‘0’ obj.position.x = 1 print obj.position.x # still prints ‘0’ As the article states, this means that value types are mostly immutable. However, this is a problem as I was planning on using a vector library that is implemented as seen above. Are there any workarounds for working with existing libraries that rely on value types? Modifying the library would be the very last resort, but I'd rather avoid that.

    Read the article

  • .Net Array or IList<T> from NumPy array in IronPython?

    - by Barry Wark
    Imagine I have a .Net application that supports user extensions in the form of Python modules by embedding IronPython. Using Ironclad, I can allow users to make use of the NumPy and SciPy packages from within their modules. How good is the interop provided by Ironclad? My question is: can I use a NumPy array of type T provided by the user's module in the rest of my app that requires an IList<T>? Edit To clarify, IronPython exposes any Python enumerable of objects of type T as an IEnumerable<T> or an IList<T>. I'm not sure if NumPy arrays fit in this category. I would rather not have to call .tolist() on the NumPy array as the arrays may be quite large.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11  | Next Page >