Popular Python recipes tagged "meta:requires=psutil"http://code.activestate.com/recipes/langs/python/tags/meta:requires=psutil/2017-01-05T16:57:15-08:00ActiveState Code RecipesGet disk partition information with psutil (cross-platform) (Python)
2016-12-23T18:05:41-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580737-get-disk-partition-information-with-psutil-cross-p/
<p style="color: grey">
Python
recipe 580737
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/device/">device</a>, <a href="/recipes/tags/disk/">disk</a>, <a href="/recipes/tags/file_system/">file_system</a>, <a href="/recipes/tags/psutil/">psutil</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/sysadmin/">sysadmin</a>, <a href="/recipes/tags/system/">system</a>).
</p>
<p>This is a recipe that shows how to easily get disk partition information, in a cross-platform manner (for the supported OSes), from your computer's operating system, using the psutil library for Python.</p>
Give Python code a web plus command-line interface with hug (Python)
2017-01-05T16:57:15-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580742-give-python-code-a-web-plus-command-line-interface/
<p style="color: grey">
Python
recipe 580742
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/cli/">cli</a>, <a href="/recipes/tags/commandline/">commandline</a>, <a href="/recipes/tags/hug/">hug</a>, <a href="/recipes/tags/library/">library</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/python3/">python3</a>, <a href="/recipes/tags/user_interface/">user_interface</a>, <a href="/recipes/tags/web/">web</a>, <a href="/recipes/tags/web_server/">web_server</a>).
</p>
<p>This recipe shows how to take a Python function and wrap it with both a web and a command-line interface, somewhat easily, using the hug Python library. The example used shows how to wrap a function that uses the psutil library to get information on disk partitions. So you can see the disk partition info either via the web browser or the command line. The code for the recipe is shown below. It is also possible to wrap multiple functions in the same Python file, and expose all of them via both the web and the command-line.</p>
<p>More information and multiple sample outputs are available here:</p>
<p><a href="https://jugad2.blogspot.in/2017/01/give-your-python-function-webcli-hug.html" rel="nofollow">https://jugad2.blogspot.in/2017/01/give-your-python-function-webcli-hug.html</a></p>
Using websocketd with Python for web-based system monitoring (Python)
2014-01-02T22:57:02-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/578803-using-websocketd-with-python-for-web-based-system-/
<p style="color: grey">
Python
recipe 578803
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/go/">go</a>, <a href="/recipes/tags/golang/">golang</a>, <a href="/recipes/tags/psutil/">psutil</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/websockets/">websockets</a>).
</p>
<p>This is the server side of a recipe that shows how the use websocket, a tool written in Go, that sort of daemonizes a program that reads from standard input and writes to standard output, thus making it into a WebSocket server.</p>