Popular recipes tagged "reboot"http://code.activestate.com/recipes/tags/reboot/2009-08-03T10:05:38-07:00ActiveState Code RecipesShutdown your PC by using ctypes (Win32 Platform) (Python) 2009-08-03T10:05:38-07:00Shao-chuan Wanghttp://code.activestate.com/recipes/users/4168519/http://code.activestate.com/recipes/576865-shutdown-your-pc-by-using-ctypes-win32-platform/ <p style="color: grey"> Python recipe 576865 by <a href="/recipes/users/4168519/">Shao-chuan Wang</a> (<a href="/recipes/tags/ctypes/">ctypes</a>, <a href="/recipes/tags/reboot/">reboot</a>, <a href="/recipes/tags/shutdown/">shutdown</a>, <a href="/recipes/tags/system_programming/">system_programming</a>, <a href="/recipes/tags/win32/">win32</a>). </p> <p>It is true that by using win32 extension python modules, such as win32api, win32con, and win32security, we can easily shutdown the computer with a few steps. However, sometimes your python's runtime environment does not provide win32com module (because it is not a build-in module), we may have to shutdown the pc on our own.</p> <p>By using ctypes, we are still able to shutdown or reboot the PC easily.</p>