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
pyCony [open_console]: "......../test.py", line 9
=========================  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.3.tar.gz (4.8 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.3-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycony-0.1.3.tar.gz
  • Upload date:
  • Size: 4.8 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.3.tar.gz
Algorithm Hash digest
SHA256 4ac069119a5fd2907a83538896f8bcee72c1e4d12014e7969084d73d2181b8db
MD5 e1b17dc5f0a60fb7a256ebb6ba12fe72
BLAKE2b-256 172f6324e701ddf0e910e9ca0ec88d4a19fb8bb06ba1dcd012ab9e84e37b694c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycony-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.9 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 464475c9e477f59621554315f5a3d86916036cff4fa6ea1a88a3068f3270f8c4
MD5 4d2d6cfe86e7f92b13d0d7366ab5df71
BLAKE2b-256 0ec6bd88c3d8718827041a3eb95a5b37f6adc317f6628d3d12acbde10e336ec1

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