Python threads with suncc (Forte 6.1) compiler

Pataki Gábor gabor.pataki at
Thu Aug 2 14:01:56 CEST 2001


I would like to get some help because I am in trouble with threads. I
work on a Solaris 8.0 (64 bit) system. Python is compiled with Sun CC
(Forte 6.1) compiler with threading support. A small program 
telnetting to a computer often dumps core it works fine with gcc.

Gabor Pataki

import threading
import telnetlib

def TelnetToIpw01():
        hostname = "my_hostname"
        username = "user_name"
        password = "password"
        tn = telnetlib.Telnet(hostname)
        tn.read_until("login: ")
        tn.write(username + '\n')
        tn.read_until("Password: ")
        tn.write(password + '\n')

class MyThread(threading.Thread):
        def run(self):
                print "ThreadID", self.cnt, "started"
                print "ThreadID", self.cnt, "finished"

for i in range(0,4):
        m = MyThread()
        m.cnt = i

More information about the Python-list mailing list