A module that I have written (test.py) in Python 2.6 can be imported and run perfectly well from with the Python IDLE with the commands:
import test
test.run_test_suite()
However if I use the command "python test.py" at the command line, it crashes apparently (according to traceback) on the command "import os".
As you can see from the code below, when run from the command line it should perform the same as when run inside the IDLE. Why would not running this in the IDLE cause a problem? My google-foo only can up with results when code would run at the command line but not in IDLE.
if __name__ == "__main__":
table = run_test_suite()
print '---=== Results ===---'
print_table(table)
It should be pointed out that this module is doing nothing more than large amounts of basic maths to check some externally calculated data is feasible.
the full traceback is:
Traceback (most recent call last):
File "...\Python\test.py", line 170, in <module>
print '---=== Results ===---'
File "...\Python\test.py", line 160, in build_data
if Links == False:
File "...\Python\test.py", line 103, in load_table
if Abbrev[M.solution_type()] == 'pos':
File "...\Python\test.py", line 85, in build_example
import os
File "SnapPy.pyx", line 173, in snappy.SnapPy.uFatalError (SnapPy.c:5507)
snappy.SnapPy.SnapPeaFatalError:
SnapPea crashed in function cusp_modulus(), defined in cusp_modulus.c.