Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Hmm... there's several typos in your example, so I wonder if your actual code has some typos as well. Here's the complete source from a quick test that does work fine without import errors.</p> <p>SomeUtils.py:</p> <pre><code>def funct1(): print('Function 1') def funct2(): print('Function 2') class MyClass1(object): def __init__(self): print('MyClass') </code></pre> <p>main.py:</p> <pre><code>from SomeUtils import * def main(): funct1() aObj = MyClass1() if (__name__ == "__main__"): main() </code></pre> <p>[EDIT Based on OP additional info]</p> <p>I still can't recreate the same error, but the code you posted won't initially work for at least a couple of errors in the XWinInfox.py <strong>init</strong> method:</p> <pre><code>self.WinID = pWinID #change to 'aWinID' since pWinID is not defined self.Title = GetWindowTitle(pWinID) #change to 'aWinID'since pWinID is not defined </code></pre> <p>so a corrected version would read:</p> <pre><code>self.WinID = aWinID self.Title = GetWindowTitle(aWinID) </code></pre> <p>Also, you have a typo in your init file name, there should be two underscores before AND after the 'init' word. Right now you have <code>'__init_.py'</code> and it should be <code>'__init__.py'</code>, however this shouldn't keep your code from working.</p> <p>Because I don't have the RegExUtils.py code, I just stubbed out the methods that rely on that file. With the stubbed methods and correcting the aforementioned typos, the code you post now works.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload