mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
350 lines
21 KiB
HTML
350 lines
21 KiB
HTML
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
<head>
|
||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
<title>1. The windows module — PythonForWindows 0.3 documentation</title>
|
||
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
|
||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||
<link rel="stylesheet" href="_static/css/mbasic.css" type="text/css" />
|
||
<script type="text/javascript" src="_static/documentation_options.js"></script>
|
||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||
<link rel="index" title="Index" href="genindex.html" />
|
||
<link rel="search" title="Search" href="search.html" />
|
||
<link rel="next" title="2. The windows objects" href="various.html" />
|
||
<link rel="prev" title="Welcome to PythonForWindows’s documentation!" href="index.html" />
|
||
</head><body>
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>Navigation</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="genindex.html" title="General Index"
|
||
accesskey="I">index</a></li>
|
||
<li class="right" >
|
||
<a href="py-modindex.html" title="Python Module Index"
|
||
>modules</a> |</li>
|
||
<li class="right" >
|
||
<a href="various.html" title="2. The windows objects"
|
||
accesskey="N">next</a> |</li>
|
||
<li class="right" >
|
||
<a href="index.html" title="Welcome to PythonForWindows’s documentation!"
|
||
accesskey="P">previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="index.html">PythonForWindows 0.3 documentation</a> »</li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="document">
|
||
<div class="documentwrapper">
|
||
<div class="bodywrapper">
|
||
<div class="body" role="main">
|
||
|
||
<div class="section" id="the-windows-module">
|
||
<h1>1. The <code class="docutils literal notranslate"><span class="pre">windows</span></code> module<a class="headerlink" href="#the-windows-module" title="Permalink to this headline">¶</a></h1>
|
||
<p>The <code class="docutils literal notranslate"><span class="pre">windows</span></code> module is the module installed by <code class="file docutils literal notranslate"><span class="pre">setup.py</span></code>.</p>
|
||
<p>This module exports some objects representing the current state of the system.
|
||
It also offers some submodules aimed to help the interfacing with <code class="docutils literal notranslate"><span class="pre">Windows</span></code> and native code execution.</p>
|
||
<dl class="docutils">
|
||
<dt>The defaults objects accessible in <code class="docutils literal notranslate"><span class="pre">windows</span></code> are:</dt>
|
||
<dd><ul class="first last simple">
|
||
<li><code class="docutils literal notranslate"><span class="pre">system</span></code> of type <a class="reference internal" href="#windows.winobject.system.System" title="windows.winobject.system.System"><code class="xref py py-class docutils literal notranslate"><span class="pre">windows.winobject.system.System</span></code></a></li>
|
||
<li><code class="docutils literal notranslate"><span class="pre">current_process</span></code> of type <a class="reference internal" href="process.html#windows.winobject.process.CurrentProcess" title="windows.winobject.process.CurrentProcess"><code class="xref py py-class docutils literal notranslate"><span class="pre">windows.winobject.process.CurrentProcess</span></code></a></li>
|
||
<li><code class="docutils literal notranslate"><span class="pre">current_thread</span></code> of type <a class="reference internal" href="process.html#windows.winobject.process.CurrentThread" title="windows.winobject.process.CurrentThread"><code class="xref py py-class docutils literal notranslate"><span class="pre">windows.winobject.process.CurrentThread</span></code></a></li>
|
||
</ul>
|
||
</dd>
|
||
<dt>The submodules that you might use by themself are:</dt>
|
||
<dd><ul class="first last simple">
|
||
<li><a class="reference internal" href="generated.html#module-windows.generated_def" title="windows.generated_def"><code class="xref py py-mod docutils literal notranslate"><span class="pre">windows.generated_def</span></code></a></li>
|
||
<li><a class="reference internal" href="native_exec.html#module-windows.native_exec" title="windows.native_exec"><code class="xref py py-mod docutils literal notranslate"><span class="pre">windows.native_exec</span></code></a></li>
|
||
<li><a class="reference internal" href="winproxy.html#module-windows.winproxy" title="windows.winproxy"><code class="xref py py-mod docutils literal notranslate"><span class="pre">windows.winproxy</span></code></a></li>
|
||
<li><a class="reference internal" href="wintrust.html#module-windows.wintrust" title="windows.wintrust"><code class="xref py py-mod docutils literal notranslate"><span class="pre">windows.wintrust</span></code></a></li>
|
||
<li><a class="reference internal" href="crypto.html#module-windows.crypto" title="windows.crypto"><code class="xref py py-mod docutils literal notranslate"><span class="pre">windows.crypto</span></code></a></li>
|
||
<li><a class="reference internal" href="utils.html#module-windows.utils" title="windows.utils"><code class="xref py py-mod docutils literal notranslate"><span class="pre">windows.utils</span></code></a></li>
|
||
<li><a class="reference internal" href="debug.html#module-windows.debug" title="windows.debug"><code class="xref py py-mod docutils literal notranslate"><span class="pre">windows.debug</span></code></a></li>
|
||
<li><a class="reference internal" href="alpc.html#module-windows.alpc" title="windows.alpc"><code class="xref py py-mod docutils literal notranslate"><span class="pre">windows.alpc</span></code></a></li>
|
||
<li><a class="reference internal" href="pipe.html#module-windows.pipe" title="windows.pipe"><code class="xref py py-mod docutils literal notranslate"><span class="pre">windows.pipe</span></code></a></li>
|
||
<li><a class="reference internal" href="rpc.html#module-windows.rpc" title="windows.rpc"><code class="xref py py-mod docutils literal notranslate"><span class="pre">windows.rpc</span></code></a></li>
|
||
<li><a class="reference internal" href="com.html#module-windows.com" title="windows.com"><code class="xref py py-mod docutils literal notranslate"><span class="pre">windows.com</span></code></a></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<div class="section" id="the-system-object">
|
||
<span id="object-system"></span><h2>1.1. The <code class="docutils literal notranslate"><span class="pre">system</span></code> object<a class="headerlink" href="#the-system-object" title="Permalink to this headline">¶</a></h2>
|
||
<div class="admonition note">
|
||
<p class="first admonition-title">Note</p>
|
||
<p class="last">See sample <a class="reference internal" href="sample.html#sample-system"><span class="std std-ref">windows.system</span></a></p>
|
||
</div>
|
||
<dl class="class">
|
||
<dt id="windows.winobject.system.System">
|
||
<em class="property">class </em><code class="descclassname">windows.winobject.system.</code><code class="descname">System</code><a class="reference internal" href="_modules/windows/winobject/system.html#System"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#windows.winobject.system.System" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The state of the current <code class="docutils literal notranslate"><span class="pre">Windows</span></code> system <code class="docutils literal notranslate"><span class="pre">Python</span></code> is running on</p>
|
||
<dl class="attribute">
|
||
<dt id="windows.winobject.system.System.bitness">
|
||
<code class="descname">bitness</code><a class="headerlink" href="#windows.winobject.system.System.bitness" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The bitness of the system</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a> – 32 or 64</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="windows.winobject.system.System.computer_name">
|
||
<code class="descname">computer_name</code><a class="headerlink" href="#windows.winobject.system.System.computer_name" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The name of the computer</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="windows.winobject.system.System.handles">
|
||
<code class="descname">handles</code><a class="headerlink" href="#windows.winobject.system.System.handles" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The list of system handles</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body">[<a class="reference internal" href="handle.html#windows.winobject.handle.Handle" title="windows.winobject.handle.Handle"><code class="xref py py-class docutils literal notranslate"><span class="pre">Handle</span></code></a>] – A list of Hanlde</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="windows.winobject.system.System.logicaldrives">
|
||
<code class="descname">logicaldrives</code><a class="headerlink" href="#windows.winobject.system.System.logicaldrives" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>List of logical drives [C:, …]</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body">[<a class="reference internal" href="volume.html#windows.winobject.volume.LogicalDrive" title="windows.winobject.volume.LogicalDrive"><code class="xref py py-class docutils literal notranslate"><span class="pre">LogicalDrive</span></code></a>] – A list of LogicalDrive</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="windows.winobject.system.System.network">
|
||
<code class="descname">network</code><em class="property"> = <windows.winobject.network.Network object></em><a class="headerlink" href="#windows.winobject.system.System.network" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Object of class <a class="reference internal" href="network.html#windows.winobject.network.Network" title="windows.winobject.network.Network"><code class="xref py py-class docutils literal notranslate"><span class="pre">windows.winobject.network.Network</span></code></a></p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="windows.winobject.system.System.processes">
|
||
<code class="descname">processes</code><a class="headerlink" href="#windows.winobject.system.System.processes" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The list of running processes</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body">[<a class="reference internal" href="process.html#windows.winobject.process.WinProcess" title="windows.winobject.process.WinProcess"><code class="xref py py-class docutils literal notranslate"><span class="pre">WinProcess</span></code></a>] – A list of Process</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="windows.winobject.system.System.product_type">
|
||
<code class="descname">product_type</code><a class="headerlink" href="#windows.winobject.system.System.product_type" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The product type, value might be:</p>
|
||
<blockquote>
|
||
<div><ul class="simple">
|
||
<li>VER_NT_WORKSTATION(0x1L)</li>
|
||
<li>VER_NT_DOMAIN_CONTROLLER(0x2L)</li>
|
||
<li>VER_NT_SERVER(0x3L)</li>
|
||
</ul>
|
||
</div></blockquote>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#long" title="(in Python v2.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">long</span></code></a> or <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a> (or subclass)</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="windows.winobject.system.System.registry">
|
||
<code class="descname">registry</code><em class="property"> = <windows.winobject.registry.Registry object></em><a class="headerlink" href="#windows.winobject.system.System.registry" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Object of class <a class="reference internal" href="registry.html#windows.winobject.registry.Registry" title="windows.winobject.registry.Registry"><code class="xref py py-class docutils literal notranslate"><span class="pre">windows.winobject.registry.Registry</span></code></a></p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="windows.winobject.system.System.services">
|
||
<code class="descname">services</code><a class="headerlink" href="#windows.winobject.system.System.services" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The list of services</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body">[<a class="reference internal" href="service.html#windows.winobject.service.ServiceA" title="windows.winobject.service.ServiceA"><code class="xref py py-class docutils literal notranslate"><span class="pre">ServiceA</span></code></a>] – A list of Service</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="windows.winobject.system.System.threads">
|
||
<code class="descname">threads</code><a class="headerlink" href="#windows.winobject.system.System.threads" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The list of running threads</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body">[<a class="reference internal" href="process.html#windows.winobject.process.WinThread" title="windows.winobject.process.WinThread"><code class="xref py py-class docutils literal notranslate"><span class="pre">WinThread</span></code></a>] – A list of Thread</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="windows.winobject.system.System.version">
|
||
<code class="descname">version</code><a class="headerlink" href="#windows.winobject.system.System.version" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The version of the system</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body">(<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a>, <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a>) – (Major, Minor)</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="windows.winobject.system.System.version_name">
|
||
<code class="descname">version_name</code><a class="headerlink" href="#windows.winobject.system.System.version_name" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The name of the system version, values are:</p>
|
||
<blockquote>
|
||
<div><ul class="simple">
|
||
<li>Windows Server 2016</li>
|
||
<li>Windows 10</li>
|
||
<li>Windows Server 2012 R2</li>
|
||
<li>Windows 8.1</li>
|
||
<li>Windows Server 2012</li>
|
||
<li>Windows 8</li>
|
||
<li>Windows Server 2008</li>
|
||
<li>Windows 7</li>
|
||
<li>Windows Server 2008</li>
|
||
<li>Windows Vista</li>
|
||
<li>Windows XP Professional x64 Edition</li>
|
||
<li>TODO: version (5.2) + is_workstation + bitness == 32 (don’t even know if possible..)</li>
|
||
<li>Windows Server 2003 R2</li>
|
||
<li>Windows Server 2003</li>
|
||
<li>Windows XP</li>
|
||
<li>Windows 2000</li>
|
||
<li>“Unknow Windows <version={0} | is_workstation={1}>”.format(version, is_workstation)</li>
|
||
</ul>
|
||
</div></blockquote>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="windows.winobject.system.System.wmi">
|
||
<code class="descname">wmi</code><a class="headerlink" href="#windows.winobject.system.System.wmi" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>An object to perform wmi requests to various namespaces</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><a class="reference internal" href="wmi.html#windows.winobject.wmi.WmiManager" title="windows.winobject.wmi.WmiManager"><code class="xref py py-class docutils literal notranslate"><span class="pre">WmiManager</span></code></a></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||
<div class="sphinxsidebarwrapper">
|
||
<h3><a href="index.html">Table Of Contents</a></h3>
|
||
<ul>
|
||
<li><a class="reference internal" href="#">1. The <code class="docutils literal notranslate"><span class="pre">windows</span></code> module</a><ul>
|
||
<li><a class="reference internal" href="#the-system-object">1.1. The <code class="docutils literal notranslate"><span class="pre">system</span></code> object</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
<h4>Previous topic</h4>
|
||
<p class="topless"><a href="index.html"
|
||
title="previous chapter">Welcome to PythonForWindows’s documentation!</a></p>
|
||
<h4>Next topic</h4>
|
||
<p class="topless"><a href="various.html"
|
||
title="next chapter">2. The <code class="docutils literal notranslate"><span class="pre">windows</span></code> objects</a></p>
|
||
<div role="note" aria-label="source link">
|
||
<h3>This Page</h3>
|
||
<ul class="this-page-menu">
|
||
<li><a href="_sources/windows.rst.txt"
|
||
rel="nofollow">Show Source</a></li>
|
||
</ul>
|
||
</div>
|
||
<div id="searchbox" style="display: none" role="search">
|
||
<h3>Quick search</h3>
|
||
<div class="searchformwrapper">
|
||
<form class="search" action="search.html" method="get">
|
||
<input type="text" name="q" />
|
||
<input type="submit" value="Go" />
|
||
<input type="hidden" name="check_keywords" value="yes" />
|
||
<input type="hidden" name="area" value="default" />
|
||
</form>
|
||
</div>
|
||
</div>
|
||
<script type="text/javascript">$('#searchbox').show(0);</script>
|
||
</div>
|
||
</div>
|
||
<div class="clearer"></div>
|
||
</div>
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>Navigation</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="genindex.html" title="General Index"
|
||
>index</a></li>
|
||
<li class="right" >
|
||
<a href="py-modindex.html" title="Python Module Index"
|
||
>modules</a> |</li>
|
||
<li class="right" >
|
||
<a href="various.html" title="2. The windows objects"
|
||
>next</a> |</li>
|
||
<li class="right" >
|
||
<a href="index.html" title="Welcome to PythonForWindows’s documentation!"
|
||
>previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="index.html">PythonForWindows 0.3 documentation</a> »</li>
|
||
</ul>
|
||
</div>
|
||
<div class="footer" role="contentinfo">
|
||
© Copyright 2015, Clement Rouault.
|
||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||
</div>
|
||
</body>
|
||
</html> |