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.1.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.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pycony-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a9bcd3fe1aa09e122b544f02c0a23edd176cff8a9d52ecbc161c68b4cc34f1db
MD5 e7984d124dac65ece85d33a99815e516
BLAKE2b-256 b4cd9996893af5de9790aa5910564184789f38104ddc843633013f457eecd9bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycony-0.1.1-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.12.7

File hashes

Hashes for pycony-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 05acde8b7c86d0ec6bc0112d52ae5b0bb86dc13fa3811d5e5ddc9d87d76e5e1e
MD5 db056fa89ebdc5bc2c81e0165d0f2f86
BLAKE2b-256 e1b837c3a58956567643c39cc10da0020bbf3e5df651bf3f8e4f1507c269f76e

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