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.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

pygoto-1.0.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file pygoto-1.0.1.tar.gz.

File metadata

  • Download URL: pygoto-1.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for pygoto-1.0.1.tar.gz
Algorithm Hash digest
SHA256 15d2d599471af8a668860d3bf70c01f578925d1941e39db51c65c05ea244765f
MD5 ff6c167328f8031f55401b10ba3e263d
BLAKE2b-256 8ae6d4113a7d5369e25e4965ece95f666d46e8216ad689c90c3f60b0ab634f4c

See more details on using hashes here.

File details

Details for the file pygoto-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pygoto-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for pygoto-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 05d479fdeafcfa10eb7df2f733123f2e085ecb5b028fddbd83871807bd47f1b9
MD5 651ea69860726f50ed13dc69181ceefc
BLAKE2b-256 4f2b3462416da60ce11deaf2d13404ce14478e997c10c49d841de03f5a7b0101

See more details on using hashes here.

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