Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Further to this below, I am seeing the same behaviour if I use ipy.exe - in the 2.7 version I can debug sub-folders/files, but not in version 3.4

I work in an environment where IronPython is hosted in a .NET executable.
When the environment was based on v2.7, I could split my code into packages, and use VS2017 to debug with breaklines, inspections in any file.
Now the environment is based on v3.4, I can only use breakpoints in the top level script, not any package sub-files.
Can anyone advise what might be causing this behaviour.

I have written a lightweight .NET app which demonstrates the problem.
App has references to IronPython, IronPython.Modules, Microsoft.Dyamic and Microsoft.Scripting

If I reference these libraries from IronPython2.7 then everything executes as expected (the string "Hello Wyn" appears in the textbox), and I can place breakpoints in any of the python files

When the libraries are referenced from IronPython3.4 then the code still executes as it should, but now I can only place breakpoints in the MyScript.py file. The ones in the other python files are ignored.

Please can anyone help - I am guessing something has changed between v2.7 and v3.4 but I don't really know where to start looking to try to solve the problem.
Many thanks

The engine is setup as

    Dictionary<string, object> options = new Dictionary<string, object>();
    options["Debug"] = true;
    m_engine = Python.CreateEngine(options);
    m_scope = m_engine.CreateScope();
    m_scope.SetVariable("txtOutput", txtOutput);
    ScriptSource source = m_engine.CreateScriptSourceFromFile(scriptFileName);
    source.Execute(m_scope);

my python structure is
MyScript.py
/MyPythonPackage/init.py
/MyPythonPackage/PythonClass.py

init.py:

from .PythonClass import PythonClass

PythonClass.py:

class PythonClass(object):
    """description of class"""
    def __init__(self, textBox):
        self.textBox = textBox
    def execute(self, name):
        self.textBox.Text = "Hello {}".format(name)

MyScript.py:

import sys
from MyPythonPackage import PythonClass

cls = PythonClass(textBox=txtOutput)
cls.execute("Wyn")
You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.