Giter Club home page Giter Club logo

inspect-shell's Introduction

Ever want to know what the hell that python script is doing? Enter the Inspect Shell. Inspect Shell lets you print/alter globals and run functions without interrupting the running script. Now with auto-complete and command history (only on linux).

Inspect Shell is not a pdb-style debugger.

How to set up

Put inspect_shell.py in the directory of the script you want to inspect.

Add

import inspect_shell

to the top of that script.

That's it.

How to use

Run your script. Then run:

$ python inspect_shell.py

You'll now have an interactive shell to your script. Anything you do will affect the script on the fly. However, be mindful that Inspect Shell provides no locking when you're altering global namespace of your script. The best uses for Inspect Shell are for passive inspection of objects.

Example

$ rs:1234> print some_module
<module 'some_module' from '/whatever'>

$ rs:1234> print some_module.some_config_value
492

$ rs:1234> some_module.some_config_value = 292

...And your script keeps on running, but with whatever changes you made from the shell.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.