Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 669 Bytes

README.md

File metadata and controls

49 lines (33 loc) · 669 Bytes

gotolibr

A simple library that allows you to use goto in Python.

It's implemented using the commands argument of pdb.set_trace, which was added in Python 3.14.

Installation

Python 3.14 or higher is required for this library to function properly.

$ python3 -m pip install gotolibr

How to use

First, import the library:

from gotolibr import goto

Jump to an absolute line number:

goto(1)

Jump to a relative line number:

goto(-1, relative=True)

Example

from gotolibr import goto

a = 0
a += 1
print(a)
if a > 5:
    goto(4, relative=True)
else:
    goto(4)

print('Finish')