python - save workbook with openpyxl in ironpython -


In a problem I used to save the Axl file using OpenPixel using the embedded IronPathon runtime engine in a NAT 4.0 application I am running, however, when the same code is running inside the IronPython interpreter, I have not found any errors and the save is successful. In reality, the code is as simple as this:

  import sys.path .append (r'c: \ python27 \ lib \ site-packages ') Import openpyxl wb = openpyxl.Workbook () Wb.save (r'c: \ save \ to \ somewhere.xlsx')  

to this code. While walking inside the NET app, I get the following stack trace: An error occurred in

I am starting with Python engine with the following code:

  _pythonEngine = Python.CreateEngine (engineDict) ; _memStream = New system. IO.MemoryStream (); _streamWriter = new util.EventRaisingStreamWriter (_memStream); _pythonEngine.Runtime.IO.SetErrorOutput (_memStream, _streamWriter); _pythonEngine.Runtime.IO.SetOutput (_memStream, _streamWriter);  

_streamwriter is a wrapper to send output to events in a text box.

Why can not I save myself from an interpreter without any issue and with the engine? I did not try to redirect the output streams and there was a single error.

  • IronPath version = 2.7.0.40 (file version 2.7.4.1000)
  • OpenXL version = 1.8.5
  • Python version = 2.7.6
  • Thank you.

    It seems that you are using part of CPIthon stadium:

     The file "C: \ Python 27 \ lm \ xml \ sax \ saxutils.py", line 165, initially Elementian Def initialize Elementian (self, name, QNA, ethers): file "C: \ Python27 \ Lib \ Type xml \ sax \ saxutils.py ", line 102, write typing (auto, s) type: long type: long expected, none found type  

    IronPython's stdlib is slightly different Running under interpreter It may take the IronPython stdlib, but taking it CPython Liberation in your program.

    When to embed, you can use the search path to control engine.SetSearchPaths


    Comments

    Popular posts from this blog

    import - Python ImportError: No module named wmi -

    Editing Python Class in Shell and SQLAlchemy -

    c# - MySQL Parameterized Select Query joining tables issue -