I have an embedded scripting engine in my C# application that uses IronPython 2. I create the Python runtime and add a few classes to the global namespace so that the script can import them as modules.
However, one (pretty basic) thing I can't figure out is how to send script arguments. I realize that I could just create a variable with...
How to get IronPython compiler version at runtime (interactive session)?
...
I wish to learn Python but I'm working all day in .Net as a C# developer, so I decided to download and install IronPython and integrated IronPython studio. How different or similar from the original Python it is? As a .Net developer can I expect to run conventional Python script in .Net environment with no problem or this is just the sam...
Cyrillic characters are displayed incorrect while entering
in interactive mode if interpreter was started with -X:TabCompletion switch.
It looks like that:
s="????"
...
I need some help finding a solution to a memory leak I'm having. I have a C# application (.NET v3.5) that allows a user to run IronPython scripts for testing purposes. The scripts may load different modules from the Python standard library (as included with IronPython binaries). However, when the script is completed, the memory allocated...
Hello all, first time poster.
I'm turning to my first question on stack overflow because I've found little resources in trying to find an answer. I'm looking to execute Selenium python tests from a C# application. I don't want to have to compile the C# Selenium tests each time; I want to take advantage of IronPython scripting for dyna...
To embed some IronPython Code into C# I want to use the ScriptEngine
using IronPython.Hosting;
using Microsoft.Scripting.Hosting;
I found the reference for IronPython, but where is the necessary reference for Scripting.Hosting? I can't find it within VisualStudio 2008, targeting .Net 3.5.
...
I have a python script which works well when it isn't compiled but when I compile it using pyc it is unable to access the standard python libraries (sys and os in this case). Is there a way of compiling them into the project?
...
Hi,
I would like to give sources for what I'm saying but I just dont have them, it's something I heard.
Once a programming professor told me that some software benchmarking done to .net vs Python in some particular items it gave a relation of 5:8 in favor of .NET . That was his argument in favor of Python not being so much slower than ...
Hello,
I have an IronPython script that execute some exes. I want to stop the execution of the current exe if its runtime exceeds a certain amount of time. How can I do this?
Current function:
def execute(programName):
t0 = time.time()
#should stop the execution of "programName"
#if execution exceeds limit
p = os.popen...
I would like to compile and distribute (on .net) some python programs that work well with IronPython, but I am new to .net and am getting errors related to particular python modules. There is a utility for compiling to low level .net and it works well, but I get errors when dealing with common libraries; code that runs in the interprete...
I have a WPF app that controls audio hardware. It uses the same PythonEngine on multiple threads. This causes strange errors I see from time to time where the PythonEngines Globals dictionary has missing values. I am looking for some guidance on how to debug/fix this.
The device has multiple components [filter's, gain's, etc.]. Each co...
I'm trying IronPython for asp.net, I got a simple CRUD screen to work. I've read IntelliSense doesnt work for IronPython, but is there any way to get rid of Visual Studio underlining all the lines' starting tokens with blue and a message of "expected declaration"?
...
I need an IronPython\Python example that would show C#/VB.NET developers how awesome this language really is.
I'm looking for an easy to understand code snippet or application I can use to demo Python's capabilities.
Any thoughts?
...
Hi,
I tried to bring a previously done webform made in vb.net to an IronPython asp.net website with no luck. After seeing it didnt work, I tried to write the simplest codebehind vb.net webform to see if there was a problem with vb.net in an IronPython website and I got the following usual error
"be sure that the defined class in this ...
Unit tests have different requirements than production code. For example, unit tests may not have to be as performant as the production code.
Perhaps it sometimes makes sense to write your unit tests in a language that is better suited to writing unit tests? The specific example I have in mind is writing an application in C# but using I...
I am trying to implement a Comet style (e.g. chat) application using IronPython. While I don't need to scale to twitter like dimensions, it is vital that the response time is lightening fast. All the possibilities in Python (Twisted, Tornado, Magnum-Py) do not work with IronPython, often because of epoll support.
Is there a default ch...
I am unable to rollback using the following code snippet and need help:
import clr
import sys
clr.AddReference('System.Data')
from System.Data.SqlClient import SqlConnection, SqlParameter, SqlTransaction
conn_string = "****"
connection = SqlConnection(conn_string)
connection.Open()
createuser = connection.CreateCommand()
createuser.Comm...
The following import works inside ipy.exe prompt but fails using IronPython ScriptRuntime inside a C# 4.0 program.
import ConfigParser
C# code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IronPython.Hosting;
using Microsoft.Scripting.Hosting;
namespace CSharpDynamic
{
class Program
{...
What's the equivalent of this in IronPython? Is it just a try-finally block?
using (var something = new ClassThatImplementsIDisposable())
{
// stuff happens here
}
...