home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / misc / 4101 < prev    next >
Encoding:
Text File  |  1993-01-09  |  3.5 KB  |  99 lines

  1. Xref: sparky comp.lang.misc:4101 comp.sys.sgi:18646
  2. Path: sparky!uunet!mcsun!sun4nl!cwi.nl!guido
  3. From: guido@cwi.nl (Guido van Rossum)
  4. Newsgroups: comp.lang.misc,comp.sys.sgi
  5. Subject: Python 0.9.8 released
  6. Message-ID: <8576@charon.cwi.nl>
  7. Date: 9 Jan 93 20:48:22 GMT
  8. Sender: news@cwi.nl
  9. Followup-To: comp.lang.misc
  10. Lines: 87
  11.  
  12. I have finally released the long-awaited Python version 0.9.8.  Boy
  13. has it been a heavy delivery!  But the baby is healthy as can be...
  14. (If you don't know what Python is, there's a short blurb behind my
  15. signature.  The tutorial in the ftp'able docs tells you more.)
  16.  
  17. I am crossposting this to comp.sys.sgi because Python, while being
  18. portable to most UNIX versions, has a number of platform-specific
  19. modules for the SGI that interface to GL, FORMS, libimage.a, and the
  20. Indigo audio and video libraries and hardware.  Sample applications
  21. are included.  If you want to learn GL by experimentation, Python
  22. might be just the tool for you!
  23.  
  24. You can ftp it from the following sites:
  25.  
  26. Location    Site            IP address         Directory
  27.  
  28. Amsterdam    ftp.cwi.nl        192.16.184.180        /pub/python
  29. U.S.A.        wuarchive.wustl.edu    128.252.135.4        /pub
  30.  
  31. The filename is python0.9.8.tar.Z.  There's also a file containing
  32. PostScript of the documentation (tutorial, reference, library):
  33. pythondoc-ps0.9.8.tar.Z.  If you're using an earlier version of Python
  34. now, you may want to fetch the files python-NEWS-0.9.8 to see what has
  35. changed.
  36.  
  37. The version on wuarchive is likely to evaporate some time after it is
  38. installed; I will try to make sure that the version on ftp.cwi.nl is
  39. always there.  You are invited to copy these files to other ftp
  40. archives to which you have access.
  41.  
  42. Please don't ask me to mail you the files, use a mail-ftp gateway.
  43. (And be advised that the compressed source is almoset 2 Meg.)
  44.  
  45. If you experience any kind of trouble with building or using 0.9.8,
  46. please mail me a short description giving as much detail as possible
  47. about what system and configuration you are using and what kind of
  48. error messages you get.  I will try to do something about it,
  49. providing either a work-around or patch.
  50.  
  51. --Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
  52.  
  53. ===============================================================================
  54. What is Python?
  55. ---------------
  56.  
  57. Python is an interpreted, interactive, object-oriented programming
  58. language.  It incorporates modules, exceptions, dynamic typing, very
  59. high level dynamic data types, and classes.  Python combines
  60. remarkable power with very clear syntax.  It has interfaces to many
  61. system calls and libraries, as well as to various window systems, and
  62. is extensible in C or C++.  It is also usable as an extension language
  63. for applications that need a programmable interface.  Finally, Python
  64. is portable: it runs on many brands of UNIX, on the Mac, and on
  65. MS-DOS.
  66.  
  67. As a short example of what Python looks like, here's a script to
  68. print prime numbers (not blazingly fast, but readable!).  When this
  69. file is made executable, it is callable directly from the UNIX shell
  70. (if your system supports #! in scripts and the python interpreter is
  71. installed at the indicated place).
  72.  
  73. #!/usr/local/bin/python
  74.  
  75. # Print prime numbers in a given range
  76.  
  77. def main():
  78.     import sys
  79.     min, max = 2, 0x7fffffff
  80.     if sys.argv[1:]:
  81.         min = int(eval(sys.argv[1]))
  82.         if sys.argv[2:]:
  83.             max = int(eval(sys.argv[2]))
  84.     primes(min, max)
  85.  
  86. def primes(min, max):
  87.     if 2 >= min: print 2
  88.     primes = [2]
  89.     i = 3
  90.     while i <= max:
  91.         for p in primes:
  92.             if i%p == 0 or p*p > i: break
  93.         if i%p <> 0:
  94.             primes.append(i)
  95.             if i >= min: print i
  96.         i = i+2
  97.  
  98. main()
  99.