Version of Python used in Python Mode

Yeah, it is kinda gross having all those directories laying about in the root!

To place them all within a sub-directory, you’ll have to change-up the import line and add an empty __init__.py file. For example, say that you named this sub-directory lib:

- sketch
  - lib
     __init__.py
     + twitter
     + wikipedia
     + ...
  sketch.properties
  sketch.pyde

Then in your sketch file, import modules like this:

import lib.wikipedia as wp
print (wp.summary("Wikipedia"))

Of course, you can use whatever name you like for the as part of the statement.

3 Likes