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
Release history Release notifications | RSS feed
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 details)
Built Distribution
File details
Details for the file pygoto-1.0.2.tar.gz
.
File metadata
- Download URL: pygoto-1.0.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96bd937bcf8c72804a7b1a2a851638111ee8c09e25f28ab32995443b5bf01c76 |
|
MD5 | 095fa05fe32b3fe8302e1e7e4dca9119 |
|
BLAKE2b-256 | 8914a895bf16c42119117cf2f47bc07d04b3125b36e901aa4cb67986334a85b1 |
File details
Details for the file pygoto-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: pygoto-1.0.2-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a9661e0c87b0426e0fe7462f8f192102cb42c83c7f4e53921cdd7ab6cb0d303 |
|
MD5 | 6a59179845111ccb2458b0f55f6aadfc |
|
BLAKE2b-256 | 17e5c70e584de1afc083fad00f3cb2f445a70911042ae20124d58432989aaecd |