If you already have a .pyui file then the first step is to do what I recommended in my first post above. This will get your .pyui file into Editorial. Then use Save to Python to move your Python file into Editorial. Finally, use the two line script above to import and run your Python file's main() function.