call function through variable or without parentheses in python
<p>I want to create an alias to call a function without the parentheses. Something like: </p>

<pre><code>&gt;ls=os.getcwd()
&gt;ls
&gt;"/path1"
&gt;os.chdir("/path2")
&gt;ls
&gt;"/path1"  ( the wanted output would be "/path2" )
</code></pre>

<p>Indeed "ls" always have the same value, the value in the moment of the assingment. </p>

<p>Of course I can do:</p>

<pre><code>&gt;ls=os.getcwd
</code></pre>

<p>and then call with </p>

<pre><code>&gt;ls() 
</code></pre>

<p>but I want is to call function without parentheses (of course when the function don't require an argument) </p>

<p>I tried</p>

<pre><code>&gt;def ListDir():
&gt; print(os.getcwd())
&gt;
&gt;ls=ListDir()
</code></pre>

<p>But don't work. How I can do something this? it's possible? ( Only if is easy to do ) </p>