wc3270 on Windows vs x3270 on Linux

450 views
Skip to first unread message

Mike Maliska

unread,
Jul 25, 2018, 9:43:34 AM7/25/18
to BlazeLibs
Linux
I pip x3270
I pip install py3270
I have a sample python file and it opens the terminal window just fine.

Windows
I install wc3270 (make sure it is in my path)
I pip install py3270
The same sample python file that works in Linux does not work on Windows.

Just a snip it.  Am I missing something?

import py3270
import time

print('')
print('START...')
print('')

print('Hi Mike')
from py3270 import Emulator

# use x3270 so you can see what is going on
em = Emulator(visible=True)

print('')
print('...END')
print('')

Mike Maliska

unread,
Jul 25, 2018, 9:50:32 AM7/25/18
to BlazeLibs
C:\Users\mmaliska\mystuff>python x3270.py

START...

Hi Mike

...END

Exception ignored in: <bound method Emulator.__del__ of <py3270.Emulator object at 0x028ECC70>>
Traceback (most recent call last):
  File "C:\Users\mmaliska\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py3270\__init__.py", line 276, in __del__
  File "C:\Users\mmaliska\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py3270\__init__.py", line 314, in terminate
  File "C:\Users\mmaliska\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py3270\__init__.py", line 299, in exec_command
  File "C:\Users\mmaliska\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py3270\__init__.py", line 63, in execute
  File "C:\Users\mmaliska\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py3270\__init__.py", line 225, in write
py3270.NotConnectedException:

C:\Users\mmaliska\mystuff>

Isaac

unread,
Aug 1, 2018, 2:28:06 PM8/1/18
to BlazeLibs
On Windows I am using this and it seems to be working, hopefully it helps you.

from py3270 import *
import sys, os

host = "my.local"
e = Emulator(visible=True)
e.connect(host)
e.wait_for_field()
print('start')

if e.string_found(7,1, 'string'):
print('Found text')


e.terminate()

Isaac

unread,
Aug 1, 2018, 2:31:10 PM8/1/18
to BlazeLibs
Also I'm new to Python and py3270 so if anything here can be corrected let me know.
Thanks
Reply all
Reply to author
Forward
0 new messages