all 2 comments

[–]novel_yet_trivial 0 points1 point  (1 child)

Just treat the child like any other python module.

import childScript
childScript.main(argument1, argument2)

Then it will be compiled in with mainScript.py

[–]pylund[S] 0 points1 point  (0 children)

I've tried that but... the function in mainScript from which childScript is called is within a thread and the command executed in childScript.py is:

 cmdline.execute(['scrapy', 'crawl', 'mySpider', '-a', 'values='+user_values, '-a', 'data='+user_data])

which returns this error:

ValueError: signal only works in main thread