0

I have a 'test engine' (which is a big python script that defines a lot of functions) that can run multiple 'test suites' (which are also just python scripts, that uses the functions from the test-engine to define some custom tests).

It is intended that the test-cases should be written by non-programmers so for pedagogic reasons I want to enforce that they give their scripts a .tcs extension instead of a .py extension.

When they doubleclick the main-application, the test engine will find all the .tcs files in the same directory using glob() and import all of them to execute their statements sequentially.

1
  • Thanks for pointing me to that discussion. imp.load_source("testscript","testscript.tcs") solves the problem Commented Apr 14, 2014 at 13:28

1 Answer 1

1

Thanks to Alex Thornton for pointing out the solution.

imp.load_source("importname","script.extension")

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.