home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
-
- def prefilter_PQ(self, line, continuation):
- match = match
- import re
- InteractiveShell = InteractiveShell
- import IPython.iplib
- unit_split = match('\\s*(\\w+)\\s*=\\s*(-?\\d*\\.?\\d*[eE]?-?\\d*)\\s+([a-zA-Z].*)', line)
- if unit_split:
- (var, val, units) = unit_split.groups()
- if var and val and units:
- units = units.replace('^', '**')
- line = var + ' = PhysicalQuantityInteractive(' + val + ", '" + units + "')"
-
-
- return InteractiveShell._prefilter(self, line, continuation)
-
- from IPython.iplib import InteractiveShell
- InteractiveShell.prefilter = prefilter_PQ
- del InteractiveShell
- del prefilter_PQ
- print '*** Simplified input for physical quantities enabled.'
-