home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 May / PCWorld_2002-05_cd.bin / Software / TemaCD / activepython / ActivePython-2.1.1.msi / Python21_win32com_test_testNetscape.py < prev    next >
Encoding:
Python Source  |  2001-07-26  |  582 b   |  26 lines

  1. ## AHH - I cant make this work!!!
  2.  
  3. # But this is the general idea.
  4.  
  5. import netscape
  6. import sys
  7.  
  8. error = "Netscape Test Error"
  9.  
  10. if __name__=='__main__':
  11.     n=netscape.CNetworkCX()
  12.     rc = n.Open("http://d|/temp/apyext.html", 0, None, 0, None)
  13.     if not rc: raise error, "Open method of Netscape failed"
  14.     while 1:
  15.         num, str = n.Read(None, 0)
  16.         print "Got ", num, str
  17.         if num==0:
  18.             break # used to be continue - no idea!!
  19.         if num==-1:
  20.             break
  21. #        sys.stdout.write(str)
  22.     n.Close()
  23.     print "Done!"
  24.     del n
  25.     sys.last_type = sys.last_value = sys.last_traceback = None
  26.