{"id":21002856,"url":"https://github.com/mobluse/olpybasic","last_synced_at":"2025-08-21T15:07:59.864Z","repository":{"id":80542886,"uuid":"423310353","full_name":"mobluse/olpybasic","owner":"mobluse","description":"Python with line numbers (Ordered List Python BASIC)","archived":false,"fork":false,"pushed_at":"2024-02-20T02:32:40.000Z","size":61,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-20T10:09:41.382Z","etag":null,"topics":["micropython","micropython-scripts","numworks","numworks-python","python-library"],"latest_commit_sha":null,"homepage":"https://www.reddit.com/r/numworks/comments/qlk3z6/olpybasic_python_with_line_numbers_ordered_list/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mobluse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-01T02:11:41.000Z","updated_at":"2022-11-20T15:34:42.000Z","dependencies_parsed_at":"2024-11-19T23:00:22.551Z","dependency_job_id":null,"html_url":"https://github.com/mobluse/olpybasic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobluse%2Folpybasic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobluse%2Folpybasic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobluse%2Folpybasic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobluse%2Folpybasic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mobluse","download_url":"https://codeload.github.com/mobluse/olpybasic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243419128,"owners_count":20287806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["micropython","micropython-scripts","numworks","numworks-python","python-library"],"created_at":"2024-11-19T08:20:37.543Z","updated_at":"2025-03-13T14:13:39.882Z","avatar_url":"https://github.com/mobluse.png","language":"Python","readme":"# OLPyBASIC\nPython with line numbers (Ordered List Python BASIC (Beginners' All-purpose Symbolic Instruction Code)) is a new programming language \nwith goto. Syntax and features will change without prior notice.\n\nThere are numbers before each line and the code runs in order, but execution can jump using goto or gosub with return. \nFor each numbered line it uses Python's `exec()` function. That means it's compatible with Python3 or MicroPython in each logical line.\n*OLPyBASIC* has the advantage that you can have tutorials where you add lines to the program. It will also be easy to implement \nsingle stepping and continue after stop. Another advantage is that you can run spaghetti code in Python. This means that you \ncan easily convert old BASIC programs to run in a modern programming language that normally lacks goto. This buys you time while you \ntry to figure out how to remove the gotos, or leave them in, if your customer accepts that. Labels are supported\nusing e.g. `lbl(\"ex\")` and `goto(\"ex\")`, see the examples folder.\n\nTo start:\n\n    python3 -i olpybasic.py # Next line is an alternative if you have MicroPython in Linux or Unix.\n    ~/micropython/ports/unix/micropython -i olpybasic.py # Next line is for NumWorks calculator.\n    from olpybasic import *\n\nExample input (no need to input comments after #):\n\n    P('10 print(\"OLPyBASIC\")') # P is short for put.\n    run() # Run i.e. start program.\n    P('20 print(\"uPython\")') # If difficult to enter single quote, try P(input())\n    run()\n    P('30 x=30')\n    P('40 print(x)')\n    run()\n    P('50 x+=1')\n    P('60 if x\u003c=40:goto(40)')\n    run()\n    PM() # PM is short for paste mode\n    70 stop()\n    90 print(11*x)\n    99 ret()\n    45 gosub(90) # Enter empty line to quit paste mode.\n\nEnter:\n\n    run()\n    L() # L is short for list\n    D(50) # D is short for delete\n    L()\n    P('50 x+=2')\n    L()\n    tron() # trace on\n    run()\n    troff() # trace off\n    run()\n\nPlease create issues if you have bug reports, suggestions for e.g. code improvements (I'm a Python/MicroPython beginner), or feature requests. \nThis should be very light weight, but also comfortable to use. \n\nPlanned changes: `for` loops might be implemented, by converting them to `if` with `goto`s like in Ratfor.\n\nRun OLPyBASIC online in browser:\nhttps://my.numworks.com/python/mobluse/olpybasic  \nhttps://my.numworks.com/python/mobluse/test_olpybas  \nhttps://my.numworks.com/simulators/zzpnwo (Doesn't work now, but the [issue](https://github.com/numworks/epsilon/issues/1896) is reported.)\n\n[New Reddit](https://www.reddit.com/r/numworks/comments/qlk3z6/olpybasic_python_with_line_numbers_ordered_list/?utm_source=share\u0026utm_medium=web2x\u0026context=3)  \n[Old Reddit](https://old.reddit.com/r/numworks/comments/qlk3z6/olpybasic_python_with_line_numbers_ordered_list/?ref=share\u0026ref_source=link)\n\nThe editor is inspired by [ZX Forth Editor Manual](https://worldofspectrum.org//pub/sinclair/games-info/s/SpectrumForth(EditorUserManual).pdf).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobluse%2Folpybasic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmobluse%2Folpybasic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobluse%2Folpybasic/lists"}