Show More
@@ -1156,34 +1156,6 b' length. One could however extract all the relevant information from the' | |||
|
1156 | 1156 | IPython instance and build an appropriate regular expression. This is |
|
1157 | 1157 | left as an exercise for the reader. |
|
1158 | 1158 | |
|
1159 | ||
|
1160 | Input of physical quantities with units | |
|
1161 | --------------------------------------- | |
|
1162 | ||
|
1163 | The module PhysicalQInput allows a simplified form of input for physical | |
|
1164 | quantities with units. This file is meant to be used in conjunction with | |
|
1165 | the PhysicalQInteractive module (in the same directory) and | |
|
1166 | Physics.PhysicalQuantities from Konrad Hinsen's ScientificPython | |
|
1167 | (http://dirac.cnrs-orleans.fr/ScientificPython/). | |
|
1168 | ||
|
1169 | The Physics.PhysicalQuantities module defines PhysicalQuantity objects, | |
|
1170 | but these must be declared as instances of a class. For example, to | |
|
1171 | define v as a velocity of 3 m/s, normally you would write:: | |
|
1172 | ||
|
1173 | In [1]: v = PhysicalQuantity(3,'m/s') | |
|
1174 | ||
|
1175 | Using the PhysicalQ_Input extension this can be input instead as: | |
|
1176 | In [1]: v = 3 m/s | |
|
1177 | which is much more convenient for interactive use (even though it is | |
|
1178 | blatantly invalid Python syntax). | |
|
1179 | ||
|
1180 | The physics profile supplied with IPython (enabled via 'ipython -p | |
|
1181 | physics') uses these extensions, which you can also activate with: | |
|
1182 | ||
|
1183 | from math import * # math MUST be imported BEFORE PhysicalQInteractive | |
|
1184 | from IPython.extensions.PhysicalQInteractive import * | |
|
1185 | import IPython.extensions.PhysicalQInput | |
|
1186 | ||
|
1187 | 1159 | .. _gui_support: |
|
1188 | 1160 | |
|
1189 | 1161 | GUI event loop support support |
General Comments 0
You need to be logged in to leave comments.
Login now