Skip to main content

A cute Python utility to open an interactive console with stack inspection.

Project description

pyCony

pyCony is a small utility package for python projects debugging, reverse engineering and tracing

Installation

pip install pyCony  
#    OR 
pip install pip install git+https://github.com/rzbhatti/pyCony.git

Usage

from pycony import *

Functions

  • open_console()
  • print_stack(depth=None)
  • pickle_args(n, pkl_sufix=None, file_path=None)
  • load_pickled_args(file_path)
  • open_console_print_stack(depth=None)
  • [Optional] set_trace() --> https://docs.python.org/3/library/pdb.html

Example 1

from pycony import open_console_show_stack_depth

def my_function(arg):
    value = arg * 5
    print(f"Inside my_function with value: {value}")
    open_console_print_stack(depth=2)
    print("Back in my_function")

my_function(10)

Example 2

python test/test.py 

ouput

Inside outer_function, local_outer: 15
Inside inner_function, local_inner: 30
=========================  Interactive Console: Stack  =========================
  1. Function: outer_function
     Arguments:
       x = 10
       local_outer = 15
================================================================================
  2. Function: inner_function
     Arguments:
       y = 15
       z = 2
       local_inner = 30
================================================================================
Use Ctrl+D (or quit()) to exit and resume program flow.
 Use pickle_args(n, file_path) to dump the args
>>> 
now exiting InteractiveConsole...
Back in inner_function
Back in outer_function
Program finished.

Project details


Download files

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

Source Distribution

pycony-0.1.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycony-0.1.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file pycony-0.1.2.tar.gz.

File metadata

  • Download URL: pycony-0.1.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.2

File hashes

Hashes for pycony-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0684020864dc3b95f1d6444b41377528ae516eb81fa4920524931fa2ff3140b7
MD5 4eacce9a3e95ff40fe490d0f2c7a4838
BLAKE2b-256 5492e5322864996a8c4f17cb9cce98c9bab00c2fc1e17d13da853ab42ddaed45

See more details on using hashes here.

File details

Details for the file pycony-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pycony-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.2

File hashes

Hashes for pycony-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c1656e5d1325784f517c29c54484c7999d6147e28e7f6caa7aa07a5080c4d798
MD5 6e43d89567926615318efc9cd5d22c52
BLAKE2b-256 5e7f55c86022c6653fb5644938c89d99f37e0717bf043d0f49e50ad920ca9561

See more details on using hashes here.

Supported by

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