Skip to main content

Use goto in Python

Project description

Pygoto

Use goto in Python

Installation

From PyPI

pip3 install pygoto

From GitHub

pip3 install git+https://github.com/donno2048/pygoto

Usage / Examples

from goto import goto
flag = False
flag = not flag
print(0)
if flag:
    goto(3)
print(1)
0
0
1
from goto import goto
sum = 0
for i in range(10):
    sum += i
    if i == 5:
        goto(7)
print(sum)
15
from goto import goto
def zero(): 1/0
goto(5)
zero()
print("Done!")
Done!
from goto import goto
def zero(): 1/0
goto(4)
zero()
print("Done!")
Traceback (most recent call last):
  File "main.py", line 4, in <module>
    zero()
  File "main.py", line 2, in zero
    def zero(): 1/0
ZeroDivisionError: division by zero
from goto import goto
def zero(): 1/0
goto(3)
zero()
print("Done!")
You have passed the recursion limit, please check your goto

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

pygoto-1.0.2.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

pygoto-1.0.2-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

Supported by

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