I recently installed Python 3 on my Mac OSX 10.6.8, and so far I have had no problems with modules or import. I am writing a function that checks if a triangle has a right angle based on the length of the sides, and the manual in which the exercise was performed has a bunch of equalities to check so I can see if this works:
testEqual(is_rightangled(1.5,2.0,2.5), True) testEqual(is_rightangled(4.0,8.0,16.0), False) testEqual(is_rightangled(4.1,8.2,9.1678787077), True) testEqual(is_rightangled(4.1,8.2,9.16787), True) testEqual(is_rightangled(4.1,8.2,9.168), False) testEqual(is_rightangled(0.5,0.4,0.64031), True)
I have to explicitly import a function called testEqual (a, b, c) from a module called test, since the sample program in the manual starts with from test import testEqual , but when I typed this into my file, I got this message:
from test import testEqual ImportError: cannot import name testEqual
I believe that I should indicate the path to the test module, but I can not find it in my Python 3 library anywhere on my computer - only those 2.x that were installed with the computer, located in /Library/Python , import turtle and import math , so it should be somewhere.