From slide.o.mix at gmail.com Tue Aug 1 17:41:13 2017 From: slide.o.mix at gmail.com (Slide) Date: Tue, 01 Aug 2017 21:41:13 +0000 Subject: [Ironpython-users] Error with ironpython and Visual studio 2015 In-Reply-To: References: Message-ID: Please use the users at ironpython.groups.io group list in the future. If you are asking about Python Tools for Visual Studio, I would start here: https://www.visualstudio.com/vs/python/ and see if there are some support links. On Tue, Aug 1, 2017 at 2:30 PM shane donnelly < shanedonnelly2010 at hotmail.co.uk> wrote: > Anybody know how to solve > > "Unable to resolve "requests". IntelliSense may be missing for this > module." > > > Unable to find information online > > > Regards > > Shane > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > https://mail.python.org/mailman/listinfo/ironpython-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dsnezhkov at gmail.com Thu Aug 3 17:10:46 2017 From: dsnezhkov at gmail.com (=?UTF-8?B?4pivIEQuU25lemhrb3Y=?=) Date: Thu, 3 Aug 2017 16:10:46 -0500 Subject: [Ironpython-users] Cpython module import: ipy.exe vs. ScriptEngine semantics Message-ID: Hello, I am trying to work with prompt_toolkit module in my IronPython application, and I see different results on interactive import via ipy.exe vs. called from ScriptEngine. If I import the module in interactive console (ipy64.exe -X:Frames -X:BasicConsole) everything works. (I have to force sys,platform to read 'win32', otherwise the value is 'cli' ) >>> sys.path.append(r"C:\Python27\Lib") >>> sys.path.append(r"C:\Python27\Lib\site-packages") >>> sys.platform="win32" >>> try: ... from prompt_toolkit import prompt ... except Exception as e: ... traceback.print_exc(file=sys.stdout) ... >>> sys.executable 'c:\\IronPython-2.7.7\\ipy64.exe' However if a file with same instructions is called from C# application with ScriptEngine with CreateScriptSourceFromFile() API, I get errors on import (below). sys.path.append(r"C:\Python27\Lib") sys.path.append(r"C:\Python27\Lib\site-packages") try: sys.platform="win32" # force the use of win32 otherwise it has 'cli' from prompt_toolkit import prompt except Exception as e: traceback.print_exc(file=sys.stdout) I get the following error: Traceback (most recent call last): File ".\pfile.py", line 39, in import prompt_toolkit File "C:\Python27\Lib\site-packages\prompt_toolkit\__init__.py", line 16, in from .interface import CommandLineInterface File "C:\Python27\Lib\site-packages\prompt_toolkit\interface.py", line 19, in from .application import Application, AbortAction File "C:\Python27\Lib\site-packages\prompt_toolkit\application.py", line 3, in from .buffer import Buffer, AcceptAction File "C:\Python27\Lib\site-packages\prompt_toolkit\buffer.py", line 27, in import tempfile File "C:\Python27\Lib\tempfile.py", line 32, in import io as _io File "C:\Python27\Lib\io.py", line 69, in class IOBase(_io._IOBase): File "C:\Python27\Lib\io.py", line 71, in IOBase __doc__ = _io._IOBase.__doc__ ValueError: The path is not of a legal form. How is ipy.exe invocation is different than ScriptEngine, and how can I properly import the module? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.lozier at gmail.com Wed Aug 9 17:05:09 2017 From: stephane.lozier at gmail.com (=?UTF-8?Q?St=C3=A9phane_Lozier?=) Date: Wed, 9 Aug 2017 17:05:09 -0400 Subject: [Ironpython-users] Cpython module import: ipy.exe vs. ScriptEngine semantics In-Reply-To: References: Message-ID: Notice that in the traceback it's listing the failing files as coming from C:\Python27\Lib. IronPython has its own set of standard libraries and those need to be included when using ScriptEngine. When you use ipy.exe it loads the proper standard libraries (if you type sys.path in the interactive you should see the ipy folders listed out). My guess is that's why your script is failing. St?phane On Thu, Aug 3, 2017 at 5:10 PM, ? D.Snezhkov wrote: > Hello, > > I am trying to work with prompt_toolkit module in my IronPython > application, and I see different results on interactive import via ipy.exe > vs. called from ScriptEngine. > > If I import the module in interactive console (ipy64.exe -X:Frames > -X:BasicConsole) everything works. (I have to force sys,platform to read > 'win32', otherwise the value is 'cli' ) > > >>> sys.path.append(r"C:\Python27\Lib") > >>> sys.path.append(r"C:\Python27\Lib\site-packages") > >>> sys.platform="win32" > >>> try: > ... from prompt_toolkit import prompt > ... except Exception as e: > ... traceback.print_exc(file=sys.stdout) > ... > >>> sys.executable > 'c:\\IronPython-2.7.7\\ipy64.exe' > > > However if a file with same instructions is called from C# application > with ScriptEngine with CreateScriptSourceFromFile() API, I get errors on > import (below). > > > sys.path.append(r"C:\Python27\Lib") > sys.path.append(r"C:\Python27\Lib\site-packages") > > try: > > sys.platform="win32" # force the use of win32 otherwise it has 'cli' > > from prompt_toolkit import prompt > > except Exception as e: > > traceback.print_exc(file=sys.stdout) > > > I get the following error: > > Traceback (most recent call last): > > File ".\pfile.py", line 39, in > > import prompt_toolkit > > File "C:\Python27\Lib\site-packages\prompt_toolkit\__init__.py", line > 16, in > > from .interface import CommandLineInterface > > File "C:\Python27\Lib\site-packages\prompt_toolkit\interface.py", line > 19, in > > from .application import Application, AbortAction > > File "C:\Python27\Lib\site-packages\prompt_toolkit\application.py", > line 3, in > > from .buffer import Buffer, AcceptAction > > File "C:\Python27\Lib\site-packages\prompt_toolkit\buffer.py", line 27, > in > > import tempfile > > File "C:\Python27\Lib\tempfile.py", line 32, in > > import io as _io > > File "C:\Python27\Lib\io.py", line 69, in > > class IOBase(_io._IOBase): > > File "C:\Python27\Lib\io.py", line 71, in IOBase > > __doc__ = _io._IOBase.__doc__ > > ValueError: The path is not of a legal form. > > > How is ipy.exe invocation is different than ScriptEngine, and how can I > properly import the module? > > Thanks. > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > https://mail.python.org/mailman/listinfo/ironpython-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From deedeebernard at hotmail.com Wed Aug 16 00:46:26 2017 From: deedeebernard at hotmail.com (Didier Bernard) Date: Wed, 16 Aug 2017 04:46:26 +0000 Subject: [Ironpython-users] What is Iron Python's version of ItemAt.AtNo and ItemAt.AtIndex? In-Reply-To: References: Message-ID: Hello, I have a piece of C# code which I would like to convert to Iron Python. This is the C# line which I do not know who to convert: object.GetVolume(indexInt, ItemAt.AtNo); There is also a similar C# line with the following second paramater: object.GetVolume2(indexInt, ItemAt.AtIndex); The first parameter is: indexInt, which represent some integer number. How would these two lines look like in Iron Python? Thank you very much for the answer! With best regards, Didier Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: From santhosh.murugadass at ansys.com Thu Aug 17 01:14:54 2017 From: santhosh.murugadass at ansys.com (Santhosh M) Date: Thu, 17 Aug 2017 10:44:54 +0530 Subject: [Ironpython-users] How to find the location(full path) of .dll file Referenced in clr.AddReference Message-ID: Hi Members, I am starting to learn Ironpython for customization of an existing CAE software. I have a basic question I am referencing some assembly .dlls like below clr.AddReference("System") clr.AddReference("Ans.Utilities") , this is specific to software that I am planning to customize. these two .dlls are successfully added, no issues in that. How can i print the location (full file path) of these two .dlls ? I tired followings but i am not successful. Request your kind advice. >>> from System.Runtime.InteropServices import RuntimeEnvironment >>>print RuntimeEnvironment.GetRuntimeDirectory() C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ >>>sysAssy = clr.AddReference("System") >>>print sysAssy.FullName 'NoneType' object has no attribute 'FullName' >>> print sysAssy.Location 'NoneType' object has no attribute 'Location' Regards, Santhosh M, ANSYS, Bangalore, INDIA. Phone: 080 - 67722500 / 080- 49010800 Mobile : +91 9663708004 -------------- next part -------------- An HTML attachment was scrubbed... URL: