Python doesn't use slash as a separator when importing module from a folder like C and C++. Use period (.) instead.
On 28.3.2010 21:07, Storm Dragon wrote:
Hi, The new code is: #Dynamic Import section customScripts = os.listdir("customizations") for i in customScripts: exec("from customizations/%s import *" % i[:-3]) #end dynamic import section I still get the syntax error: Traceback (most recent call last): File "orca-customizations.py", line 16, in <module> exec("from customizations/%s import *" % i[:-3]) File "<string>", line 1 from customizations/weather import * ^ SyntaxError: invalid syntax Thanks Storm -- Follow me on Twitter: http://www.twitter.com/stormdragon2976 My blog, Thoughts of a Dragon: http://www.stormdragon.us/ What color dragon are you? http://quizfarm.com/quizzes/new/alustriel07/what-color-dragon-would-you-be/ Install Windows Vista in under 2 minutes: http://is.gd/am6TDOn Sun, 2010-03-28 at 14:38 -0400, Haden Pike wrote:xec("from customizations.%s import *" % i[:-3)