Popular recipes tagged "user" but not "python3"http://code.activestate.com/recipes/tags/user-python3/2011-03-22T10:00:49-07:00ActiveState Code Recipesuser and root directory logfile (Python)
2011-03-22T10:00:49-07:00justin drakehttp://code.activestate.com/recipes/users/4177409/http://code.activestate.com/recipes/577619-user-and-root-directory-logfile/
<p style="color: grey">
Python
recipe 577619
by <a href="/recipes/users/4177409/">justin drake</a>
(<a href="/recipes/tags/directory/">directory</a>, <a href="/recipes/tags/log/">log</a>, <a href="/recipes/tags/time/">time</a>, <a href="/recipes/tags/user/">user</a>).
</p>
<p>script to retrieve time, current user, and root of directory
output to spam.txt</p>
<p>want to add more like windows version, bios info and other useful diagnostic information </p>
<p>free to use and modify
welcome any advice or corrections
learning python hope this turns into a script to create a organized personal report of customer's pc</p>
Subprocess As Another User (Python)
2010-12-23T00:10:08-08:00Eric Pruitthttp://code.activestate.com/recipes/users/4170757/http://code.activestate.com/recipes/577495-subprocess-as-another-user/
<p style="color: grey">
Python
recipe 577495
by <a href="/recipes/users/4170757/">Eric Pruitt</a>
(<a href="/recipes/tags/login/">login</a>, <a href="/recipes/tags/subprocess/">subprocess</a>, <a href="/recipes/tags/user/">user</a>, <a href="/recipes/tags/windows/">windows</a>).
Revision 3.
</p>
<p>Modifies the subprocess module and supplies a new class, LoginSTARTUPINFO, to launch processes as another user on Windows. Requires the pywin32 libraries, but the system ../lib/subprocess.py does not need to be modified.</p>
<pre class="prettyprint"><code>>>> import subprocesswin32 as subprocess
>>> sysuser = LoginSTARTUPINFO("username", "machine", "passwd123")
>>> stdout, stderr = subprocess.Popen("cmd.exe", stdout=subprocess.PIPE,
... startupinfo=sysuser).communicate()
</code></pre>