bin/interactive.py

Tue, 01 May 2018 00:10:23 +0200

author
David Douard <david.douard@logilab.fr>
date
Tue, 01 May 2018 00:10:23 +0200
changeset 86
96e30b092f70
parent 83
e90e7b6b876e
permissions
-rw-r--r--

[py3k] beginning to port to py3k

also write a proper setuptools based setup.py and convert some bin/* scripts
as entry_points.

#!/usr/bin/python
import sys
import os
import signal
import time

try:
    from pygpibtoolkit.gpibcontroller import GPIBController
except ImportError:
    sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
    from pygpibtoolkit.gpibcontroller import GPIBController
import pygpibtoolkit.HP3562A
import pygpibtoolkit.HP3456
import pygpibtoolkit.HP8904
from pygpibtoolkit.prologix import GPIB


import optparse
opt = optparse.OptionParser("A simple tool for detecting connected GPIB devices")
opt.add_option('-d', '--device', default="/dev/ttyUSB0",
               dest="device",
               help="Device of connected Prologix GPIB bundle [/dev/ttyUSB0]",)
options, argv = opt.parse_args(sys.argv)

cnx = GPIB(device=options.device)
c = GPIBController(cnx)


    

mercurial