[IronPython] importing the os module
Martin Maly
Martin.Maly at microsoft.com
Sun Oct 16 02:01:49 CEST 2005
In standard Python, os is not a built-in module, however, nt module is
built-in. IronPython includes built-in nt moduel (as built-in module
implemented in c#), but not the os. module.
I am not understanding your question about the IO module. There is no
"io" module in neither CPython nor IronPython:
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import io
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named io
Martin
________________________________
From: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Papanii Okai
Sent: Saturday, October 15, 2005 4:53 PM
To: 'Discussion of IronPython'
Subject: Re: [IronPython] importing the os module
Ok, so I stepped through with the debugger and found out that IO module
wasn't begin called. Are io and os built in modules? Below is a copy of
the stack trace..
Thread [#:0]
*0. IronPython.Objects.Importer.ImportTop (PythonModule.cs:182)
1. IronPython.Objects.Importer.ImportModule (PythonModule.cs:165)
2. IronPython.Modules.Builtin.__import__ (__builtin__.cs:60)
3. ReflectOpt.IronPython.Modules.Builtin.__import__ (source line
information unavailable)
4. IronPython.Objects.BuiltinFunction.Call (BuiltinFunction.cs:101)
5. IronPython.Objects.Ops.Call (Ops.cs:1423)
6. IronPython.Objects.Importer.Import (PythonModule.cs:151)
7. IronPython.Objects.Ops.Import (Ops.cs:1864)
8. input_2.Run (source line information unavailable)
9. IronPython.Hosting.PythonEngine.DoOneInteractive
(PythonEngine.cs:278)
10. IronPython.Hosting.PythonEngine.RunInteractive
(PythonEngine.cs:227)
11. IronPythonConsole.PythonCommandLine.RunInteractive
(PythonCommandLine.cs:151)
12. IronPythonConsole.PythonCommandLine.Main (PythonCommandLine.cs:40)
--Papanii
________________________________
From: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly
Sent: Saturday, October 15, 2005 6:39 AM
To: Discussion of IronPython
Subject: Re: [IronPython] importing the os module
You can either use the CPython libraries, or instead of "os" use the
"nt" module which IronPython contains.
Martin
________________________________
From: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Papanii Okai
Sent: Saturday, October 15, 2005 12:19 AM
To: users at lists.ironpython.com
Subject: [IronPython] importing the os module
Hi Guys,
I was testing out Iron Python and I was trying to test out the
OS module but I got the error ..
TraceBack (most recent call last)
At <shell>
ImportError: No module named os..
</>
Obviously it doesn't exist. Thus is there any means to get around this?
Thank you
--Papanii
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20051015/3d414646/attachment.html>
More information about the Ironpython-users
mailing list