{"id":19011481,"url":"https://github.com/perrywerneck/python3-tn3270","last_synced_at":"2025-09-06T14:33:23.571Z","repository":{"id":114542077,"uuid":"172820396","full_name":"PerryWerneck/python3-tn3270","owner":"PerryWerneck","description":"Python bindings for lib3270/pw3270","archived":false,"fork":false,"pushed_at":"2024-01-09T17:04:13.000Z","size":225,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T05:11:06.284Z","etag":null,"topics":["3270","mainframe","python"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PerryWerneck.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","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":"AUTHORS"}},"created_at":"2019-02-27T01:33:49.000Z","updated_at":"2024-07-29T18:04:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"d63f0062-7187-47cb-b129-c2c4fcbc60a9","html_url":"https://github.com/PerryWerneck/python3-tn3270","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/PerryWerneck/python3-tn3270","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerryWerneck%2Fpython3-tn3270","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerryWerneck%2Fpython3-tn3270/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerryWerneck%2Fpython3-tn3270/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerryWerneck%2Fpython3-tn3270/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PerryWerneck","download_url":"https://codeload.github.com/PerryWerneck/python3-tn3270/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerryWerneck%2Fpython3-tn3270/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273915987,"owners_count":25190568,"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","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["3270","mainframe","python"],"created_at":"2024-11-08T19:14:36.664Z","updated_at":"2025-09-06T14:33:23.218Z","avatar_url":"https://github.com/PerryWerneck.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Extension Module for TN3270 Access\n\nProvide python3 objects to remote control an active pw3270 window or to direct access a TN3270 host using lib3270.\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n![CodeQL](https://github.com/PerryWerneck/lib3270/workflows/CodeQL/badge.svg)\n[![WinPackage](https://github.com/PerryWerneck/python3-tn3270/actions/workflows/winpkg.yml/badge.svg)](https://github.com/PerryWerneck/python3-tn3270/actions/workflows/winpkg.yml)\n[![build result](https://build.opensuse.org/projects/home:PerryWerneck:pw3270/packages/python-tn3270/badge.svg?type=percent)](https://build.opensuse.org/package/show/home:PerryWerneck:pw3270/python-tn3270)\n\n## Installation\n\n[\u003cimg src=\"https://raw.githubusercontent.com/PerryWerneck/pw3270/master/branding/obs-badge-en.svg\" alt=\"Download from open build service\" height=\"80px\"\u003e](https://software.opensuse.org/download.html?project=home%3APerryWerneck%3Apw3270\u0026package=python3-tn3270)\n[\u003cimg src=\"https://github.com/PerryWerneck/pw3270/blob/develop/branding/release-badge-en.svg\" alt=\"Download from github releases\" height=\"80px\"\u003e](../../releases)\n\n## Examples\n\nGetting module version\n\n```python\n#!/usr/bin/python\n#-*- coding: utf-8\n\nimport tn3270\n\nprint(\"Using py3270 Version \" + tn3270.version() + \" revision \" + tn3270.revision())\n```\n\nGetting pw3270 version\n\n```python\n#!/usr/bin/python\n#-*- coding: utf-8\n\nimport tn3270\n\nsession = tn3270.Session(\":a\")\n\nprint(\"Using PW3270 version \" + session.version + \" revision \" + session.revision)\n```\n\nConnecting first pw3270 window to host (if not connected), getting contents\n\n```python\n#!/usr/bin/python\n#-*- coding: utf-8\n\nimport tn3270\n\nsession = tn3270.Session(\":a\")\n\nif session.reconnect.try_activate():\n\tprint(\"Reconnecting to host\")\n\tsession.wait(10)\n\nprint(session)\n```\n\nConnecting to host by url, getting some information.\n\n```python\n#!/usr/bin/python\n#-*- coding: utf-8\n\nimport tn3270\n\n# Get TN3270 headless object\nsession = tn3270.Session(\"\")\n\n# Connect to host with 10 seconds timeout\nsession.connect(\"tn3270://localhost:3270\",10)\n\n# Show connection state.\nprint(\"Cstate: \" + str(session.cstate))\nprint(\"Width: \" + str(session.width))\nprint(\"Connected: \" + str(session.connected))\n\n# Show cursor position\nprint(session.cursor)\n\n# Search for string on terminal\nprint(session.find(\"Host\"))\n\n# Count string\nprint(session.count(\"Host\"))\n\n# Get 38 characters at position 14,22\nprint(session.get(14,22,38))\n\nsession.disconnect()\n\ninput(\"Press enter to exit\")\n```\n\n## Building from sources\n\n### Linux\n\n1. Install libipc3270-devel\n\n2. Get python-tn3270 sources from git\n\n\t```shell\n\tgit clone https://github.com/PerryWerneck/python-tn3270.git ./python-tn3270\n\t```\n\n3. Build the extension using setup.py\n\n\t```shell\n\tcd python-tn3270\n\tpython setup.py build\n\t```\n\n4. Install extension\n\n\t```shell\n\tpython setup.py install\n\t```\n\t\n### Windows (With MSVC \u0026 Python SetupTools)\n\n1. Download and install Visual Studio Build Tools (https://visualstudio.microsoft.com/pt-br/downloads/)\n\n2. Get python-tn3270 sources from git\n\n\t```shell\n\tgit clone https://github.com/PerryWerneck/python-tn3270.git ./python-tn3270\n\t```\n\n3. Download and unpack libipc3270 pre-compiled image\n\n\t```shell\n\twget https://github.com/PerryWerneck/libipc3270/releases/download/5.5/msvc-libipc3270.zip\n\t7z x msvc-libipc3270.zip -y -oipc3270\n\t```\n\n4. Build the extension using setup.py\n\n\t```shell\n\tcd python-tn3270\n\tpython setup.py build\n\t```\n\n5. Install extension\n\n\t```shell\n\tpython setup.py install\n\t```\n\t\n6. Build windows installer (optional)\n\n\t```shell\n\tpython setup.py bdist_wininst\n\t```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperrywerneck%2Fpython3-tn3270","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperrywerneck%2Fpython3-tn3270","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperrywerneck%2Fpython3-tn3270/lists"}