How to get current login time in Ubuntu/Linux using python?
<p>From current login time, I mean the time at which the user logged into the system.</p>

<p>Edit : I only need to get the current login time in hh:mm format, not the username and all</p>

<pre><code>import subprocess
print subprocess.check_output("who").split()[3]
</code></pre>

<p>Output:</p>

<pre><code>22:23
</code></pre>

<p>Which is in <code>hh:mm</code> format.</p>

python ubuntu login