[IPython-dev] open() function?
Tue Aug 17 19:26:24 CDT 2010
On 08/17/2010 08:18 PM, Fernando Perez wrote:
> On Tue, Aug 17, 2010 at 8:38 AM, AK<firstname.lastname@example.org> wrote:
>> Hi, why is open() function used in ipython is imported from posix module
>> instead of the built-in open()? (Ubuntu 10.04)?
> Why do you say that? This is what I see running the IPython in 10.04:
> (python-bare)amirbar[virtualenv]> /usr/bin/ipython
> Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
> Type "copyright", "credits" or "license" for more information.
> IPython 0.10 -- An enhanced Interactive Python.
> ? -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help -> Python's own help system.
> object? -> Details about 'object'. ?object also works, ?? prints more.
> In : open?
> Type: builtin_function_or_method
> Base Class: <type 'builtin_function_or_method'>
> Namespace: Python builtin
> open(name[, mode[, buffering]]) -> file object
> Open a file using the file() type, returns a file object. This is the
> preferred way to open a file.
> I don't find any direct posix imports in the source either:
> amirbar[IPython]> grin posix
Ahh, sorry - I get it, I added import_all("os string re") to
ipy_user_conf.py and posix module methods are available in os
module. Mystery solved...
More information about the IPython-dev