testNetscape.py 638 B

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