|
Hmm, I tend to disagree with you on the fact
that in standard python os is not a built in module. Even though nt is built in,
the os modules also built in. But what is confusing is that Anthony posted that
he was able to import the os module like so… Anthony’s
post…. Double check your setup, since here is what I get importing os: He said it had something to do with my set
up. Anyway, in terms of the os module in standard python I could do something
like so. Import os doesFileExist
= os.path.isdir(FileName) if(doesFileExist):
print FileName else:
print ‘No file’ In terms of using the nt module, how would
I implement this? From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martin Maly 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 Martin From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Papanii Okai 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:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martin Maly You can either use
the CPython libraries, or instead of "os" use the "nt"
module which IronPython contains. Martin From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Papanii Okai 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 |
_______________________________________________ users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
