def setPortAddress(address=888):
 global PORT
 if (isinstance(address, basestring) and address.startswith('0x')):
  address = int(address, 16)
 if (PORT is not None):
  del PORT
 try:
  PORT = ParallelPort(address=address)
 except Exception as exp:
  logging.warning(('Could not initiate port: %s' % str(exp)))
  PORT = None

def setPortAddress ( address = 888 ) : global PORT if ( isinstance ( address , basestring ) and address . startswith ( '0x' ) ) : address = int ( address , 16 ) if ( PORT is not None ) : del PORT try : PORT = ParallelPort ( address = address ) except Exception as exp : logging . warning ( ( 'Could not initiate port: %s' % str ( exp ) ) ) PORT = None
set the memory address or device node for your parallel port of your parallel port .