Attachment 'anynumpy.py'

Download

   1 # import either NumPy, or numarray, or Numeric
   2 
   3 for name in ('numpy', 'numarray', 'Numeric'):
   4     failed = False
   5     try:
   6          eval(compile('from %s import *' % name, 'eval', 'exec'))
   7 	 if name == 'numpy':
   8 	     pass
   9 	     #from numpy.oldnumeric.compat import *
  10              #Float = float
  11              #UInt8 = uint8
  12     except ImportError:
  13         failed = True
  14     if not failed:
  15         break
  16 else:
  17     import PyQt4.Qt as Qt
  18     if not Qt.QCoreApplication.instance():
  19         a = Qt.QApplication([])
  20     Qt.QMessageBox.critical(
  21         None,
  22         'Numerical Python Extension Required',
  23         'This example requires a Numerical Python Extension, but\n'
  24         'failed to import either NumPy, or numarray, or Numeric.\n'
  25         'NumPy is available at http://sourceforge.net/projects/numpy'
  26         )
  27     raise SystemExit, (
  28         'Failed to import either NumPy, or numarray, or Numeric.\n'
  29         'NumPy is available at http://sourceforge.net/projects/numpy'
  30         )
  31 
  32 # Local Variables: ***
  33 # mode: python ***
  34 # End: ***

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2016-09-06 01:28:46, 32.6 KB) [[attachment:CondaRHEL6_001.png]]
  • [get | view] (2016-09-06 01:28:52, 72.2 KB) [[attachment:CondaRHEL6_002.png]]
  • [get | view] (2016-09-06 01:28:57, 64.1 KB) [[attachment:CondaRHEL6_003.png]]
  • [get | view] (2016-09-06 01:29:01, 50.6 KB) [[attachment:CondaRHEL6_004.png]]
  • [get | view] (2016-09-06 01:29:06, 32.7 KB) [[attachment:CondaRHEL6_005.png]]
  • [get | view] (2016-09-06 01:29:10, 31.8 KB) [[attachment:CondaRHEL6_006.png]]
  • [get | view] (2016-09-06 01:29:15, 74.1 KB) [[attachment:CondaRHEL6_007.png]]
  • [get | view] (2016-09-06 23:46:16, 103.4 KB) [[attachment:CondaRHEL6_008.png]]
  • [get | view] (2016-09-07 00:05:08, 76.3 KB) [[attachment:CondaRHEL6_009.png]]
  • [get | view] (2016-09-07 00:05:14, 76.1 KB) [[attachment:CondaRHEL6_010.png]]
  • [get | view] (2016-09-07 00:08:00, 102.5 KB) [[attachment:CondaRHEL6_011.png]]
  • [get | view] (2016-09-06 01:29:26, 36.6 KB) [[attachment:RHEL6_001.png]]
  • [get | view] (2016-09-06 01:41:43, 1.0 KB) [[attachment:anynumpy.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.