{"id":16282591,"url":"https://github.com/thomasballinger/simplerepl","last_synced_at":"2025-04-08T17:50:07.967Z","repository":{"id":141877449,"uuid":"48391748","full_name":"thomasballinger/simplerepl","owner":"thomasballinger","description":null,"archived":false,"fork":false,"pushed_at":"2016-01-01T18:41:30.000Z","size":5,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T12:54:45.317Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thomasballinger.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-21T20:09:15.000Z","updated_at":"2016-07-10T09:36:46.000Z","dependencies_parsed_at":"2023-03-16T18:16:05.363Z","dependency_job_id":null,"html_url":"https://github.com/thomasballinger/simplerepl","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/thomasballinger%2Fsimplerepl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasballinger%2Fsimplerepl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasballinger%2Fsimplerepl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasballinger%2Fsimplerepl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomasballinger","download_url":"https://codeload.github.com/thomasballinger/simplerepl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247896737,"owners_count":21014582,"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":[],"created_at":"2024-10-10T19:11:10.039Z","updated_at":"2025-04-08T17:50:07.949Z","avatar_url":"https://github.com/thomasballinger.png","language":"Python","readme":"Want to make a simple interactive REPL in Python?\n\nThe first step might be:\n\n    while True:\n        i = raw_input('enter a command: ')\n        print(i.upper())\n\nBut if you want to create a richer experience, one that might update the\nscreen after each keystroke the user types, then you might need to go deeper.\n\nGet started by installing blessed\n\n    pip install blessed\n\nNow let's update the screen after each keystroke:\n\n```\nimport sys\nimport blessed\n\nterm = blessed.Terminal()\nline = ''\n\nwith term.cbreak():\n    while True:\n        inp = term.inkey()\n        if inp == '\\n':\n            print('')\n            print(\"you hit enter!\")\n            print(line.upper())\n            line = ''\n        else:\n            line += inp\n            sys.stdout.write('\\r')\n            sys.stdout.write(line)\n            sys.stdout.flush()\n```\n\nwhat do you want to do next?\n\n* [ask the user for a limited number of characters](presseight.py)\n\n* [update the screen with more information](step2.py)\n\n* [update on keystroke whether the current line is valid](step3.py)\n\n(see step2.py and step3.py for this)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasballinger%2Fsimplerepl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomasballinger%2Fsimplerepl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasballinger%2Fsimplerepl/lists"}