Python threads with suncc (Forte 6.1) compiler

Pataki Gábor gabor.pataki at eth.ericsson.se
Thu Aug 2 08:01:56 EDT 2001


Hi,

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.

Thanks,
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"
                TelnetToIpw01()
                print "ThreadID", self.cnt, "finished"

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



More information about the Python-list mailing list