GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — coax/pycoax at master · lowobservable/coax

Expand file tree

/

pycoax

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

pycoax

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
coax
coax
 
 
examples
examples
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
requirements.txt
requirements.txt
 
 
run_unit_tests.sh
run_unit_tests.sh
 
 
setup.py
setup.py
 
 

README.md

Outline

pycoax

Python IBM 3270 coaxial interface library.

Usage

You will need to build an interface and connect it to your computer.

Install using pip:

pip install pycoax

Assuming your interface is connected to /dev/ttyACM0 and you have a CUT type terminal connected to the interface, you can do something like this:

import time
from coax import open_serial_interface, Poll, PollAck, LoadAddressCounterHi, \
                 LoadAddressCounterLo, WriteData, ReceiveTimeout

with open_serial_interface('/dev/ttyACM0') as interface:
    # Wait for a terminal to attach...
    poll_response = None
    attached = False

    while not attached:
        try:
            poll_response = interface.execute(Poll(), timeout=1)

            if poll_response:
                print(poll_response)

                interface.execute(PollAck())

            attached = True
        except ReceiveTimeout:
            print('.')

            time.sleep(1)

    # Poll the terminal until status is empty.
    while poll_response:
        poll_response = interface.execute(Poll())

        if poll_response:
            print(poll_response)

            interface.execute(Poll())

    # Move the cursor to top-left cell of a 80 column display.
    interface.execute([LoadAddressCounterHi(0), LoadAddressCounterLo(80)])

    # Write a secret message.
    interface.execute(WriteData(bytes.fromhex('a1 84 00 92 94 91 84 00 93 8e 00 83 91 88 8d 8a 00 98 8e 94 91 00 ae 95 80 8b 93 88 8d 84')))

See examples for complete examples.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.