Translating Matlab code to Python
<p>I need to translate chunks of matlab code into Python. My code seems to be 'unreachable' though. Any idea why this is happening? 
Also: am I doing it right? I'm a real newbie.</p>

<p>Matlab code:</p>

<pre><code>function Dir = getScriptDir()
    fullPath = mfilename('fullpath');
    [Dir, ~,~] = fileparts(fullPath);
end

function [list,listSize] = getFileList(Dir)
    DirResult = dir( Dir );
    list = DirResult(~[DirResult.isdir]); % select files
    listSize = size(list);
end
</code></pre>

<p>My Python code: </p>

<pre><code>def Dir = getScriptDir():
    return os.path.dirname(os.path.realpath(__file__)
def getFileList(Dir):
    list = os.listdir(Dir)
    listSize = len(list)
    getFileList() = [list, listSize]
</code></pre>