Skip to content

Yu-Jie1669/var_processor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Var_processor

Var_processor is a Python library that can automatically handle common variable operations in projects.

Now it supports automatic saving of specified variables when project exceptions or errors occur.

The project is currently under development, so let's look forward to more wonderful things together.

Features

  • Automatically saves specified local variables to a file.
  • Support all types of variables.
  • Support variables with the same name in different functions.

Installation

Install using pip:

pip install var_processor --index-url https://pypi.org/simple  

Usage

from var_processor.functional import save_on_error

@save_on_error(vars=["a", "b", "c"])
def main():
    a = 10
    b = 20.0
    c = {}

    # Raise ZeroDivisionError
    # Variables `a`, `b`, `c` will be automatically saved.
    d = a / 0

if __name__ == "__main__":
    main()
from var_processor.functional import pdb_on_error

@pdb_on_error
def main():
    a = "s"
    b = 1

    def a():
        a = "gg"
        tt = 1 / 0

    a()
    b = 1 / 0
    print("ss")


if __name__ == "__main__":
    main()

About

Var_processor is a Python library that can automatically handle common variable operations in projects.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages