Skip to main content

A human-readable alternative to dir

Project description

An alternative to Python’s dir function. Easy to type; easy to read! For humans only.

Requirements: Python 2.4+ or 3.0

License: BSD (see the LICENSE file)

Contributions are welcome. See the CHANGELOG and AUTHORS files.

Install

To install see, run:

$ pip install --upgrade see

Alternatively, to install from source:

$ python setup.py install

Usage

see is designed for the interactive Python interpreter. Import the see function like so:

>>> from see import see

Call see() without arguments to see all objects in the global scope.

>>> foo = 'bar'
>>> see()
    foo      see()

Call see(an_object) to see what you can do with an_object.

>>> number = 1
>>> see(number)
    +             -             *             /             //            %
    **            <<            >>            &             ^             |
    +obj          -obj          ~             <             <=            ==
    !=            >             >=            abs()         bool()
    divmod()      float()       hash()        help()        hex()
    int()         long()        oct()         repr()        str()
    .bit_length()               .conjugate()  .denominator  .imag
    .numerator    .real

Startup

You can use a Python startup file to ensure that see is available every time you run Python. The following example uses a startup file named .pythonrc.py in the user’s home directory:

  1. Create a startup file, if one does not already exist:

    touch ~/.pythonrc.py
  2. Open the startup file in your preferred Python editor and add the following line:

    from see import see
  3. Set the following environment variable (e.g. in ~/.bashrc for Bash):

    export PYTHONSTARTUP="$HOME/.pythonrc.py"

Now you can use see immediately after running python, without having to manually import it.

Startup for iPython

For iPython users, importing see by default requires a little more work.

  1. Create a file named ipy_profile_see.py in your ~/.ipython directory, and add the following lines:

    from IPython import ipapi
    
    def main():
        ip = ipapi.get()
        ip.ex('from see import see')
    
    main()
  2. From here, you have two options:

    1. Launch iPython with the command: ipython -profile see

    2. Open ~/.ipython/ipy_user_conf.py and add the following line inside the main() function:

      import ipy_profile_see

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

see-1.1.1.zip (9.0 kB view details)

Uploaded Source

see-1.1.1.tar.gz (7.1 kB view details)

Uploaded Source

File details

Details for the file see-1.1.1.zip.

File metadata

  • Download URL: see-1.1.1.zip
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for see-1.1.1.zip
Algorithm Hash digest
SHA256 1489efaf31d9fd3683dc9ff8db606937718449bd7cf681af87796d1d7a8d6506
MD5 c29227d7735294d5c05d9c3c5e0b1f80
BLAKE2b-256 37860d291dbdae577b9128e49763abd78450dcd9dfb891efb106260314688284

See more details on using hashes here.

File details

Details for the file see-1.1.1.tar.gz.

File metadata

  • Download URL: see-1.1.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for see-1.1.1.tar.gz
Algorithm Hash digest
SHA256 dea97d19437dfce477cc4011ab9d87268212535ca26d6a5ded018e4a2337b247
MD5 ff43ae5204fb6edf445cfa46ab40497a
BLAKE2b-256 429940b63111121792df3a97384c39ab0e4ae4add61d80cdab3749555f4d96f5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page