Plugin for Rainmeter enabling Python 3 scripting. is a fork of jblume/rainmeter-python which seems to be deleted.
Go to file
glitchassassin 96d241703d Removed sub-interpreters, Finalize 2017-02-11 20:17:23 -05:00
rainmeter-plugin-sdk@2bf0f2f24e Added rainmeter-plugin-sdk as a submodule for ease of compilation 2017-02-07 15:39:36 -05:00
.gitignore Removed sub-interpreters, Finalize 2017-02-11 20:17:23 -05:00
.gitmodules Added rainmeter-plugin-sdk as a submodule for ease of compilation 2017-02-07 15:39:36 -05:00
LICENSE initial commit 2013-03-02 19:54:45 +01:00
PyRainmeter.cpp Updated paths 2017-02-09 11:23:39 -05:00
PythonPlugin.cpp Removed sub-interpreters, Finalize 2017-02-11 20:17:23 -05:00
PythonPlugin.rc initial commit 2013-03-02 19:54:45 +01:00
README.md Added Python 3.6 2017-02-09 13:52:22 -05:00
RainmeterPython.VC.db Removed sub-interpreters, Finalize 2017-02-11 20:17:23 -05:00
RainmeterPython.sln link statically to MSVCRT 2013-03-03 00:04:49 +01:00
RainmeterPython.vcxproj Removed sub-interpreters, Finalize 2017-02-11 20:17:23 -05:00
RainmeterPython.vcxproj.filters initial commit 2013-03-02 19:54:45 +01:00
RainmeterPython.vcxproj.user Updated paths 2017-02-09 11:23:39 -05:00
appveyor.yml Fixed infinite build loop 2017-02-09 14:03:56 -05:00

README.md

rainmeter-python

Originally created by jblume, now maintained by glitchassassin

Plugin for Rainmeter enabling Python 3.4/3.5 scripting

Installation

All Releases: Github All Releases

Unzip the DLL for your Python version and copy it to the 'Plugins' folder of your Rainmeter installation.

For this plugin to function, you'll need to install the Python distribution matching your Rainmeter's architecture (Win32 or x64). If in doubt, use Python x64. The corresponding 'python3x.dll' needs to be in your DLL search path; all standard installers of Python 3 automatically put the DLL into your System32 directory, so this should normally be the case. If you see an "Error 126" in Rainmeter's logs while trying to load the plugin, this is probably your issue.

Example (Simple)

[Measure]
Measure=Plugin
Plugin=Python
PythonHome=c:\Python35-x64
ScriptPath=default.py
ClassName=Measure
UpdateDivider=1
class Measure:
  def Reload(self, rm, maxValue):
    rm.RmLog(rm.LOG_NOTICE, "Reload called")

  def Update(self):
    return 1.0

  def GetString(self):
    return 'Test'

  def ExecuteBang(self, args):
    pass

  def Finalize(self):
    pass

Example (IMAP Unread Mail Count)

[Measure]
Measure=Plugin
Plugin=Python
ScriptPath=IMAP.py
PythonHome=c:\Python35-x64
ClassName=Measure
UpdateDivider=60
Username=username
Password=password
Host=mail.com
import imaplib

class Measure:
    def Reload(self, rm, maxValue):
        self.host = rm.RmReadString('Host', 'example.com', False)
        self.username = rm.RmReadString('Username', 'user', False)
        self.password = rm.RmReadString('Password', 'pass', False)

    def Update(self):
        con = imaplib.IMAP4(self.host)
        con.starttls()
        con.login(self.username, self.password)
        con.select('INBOX', True)
        _, msgnums = con.search(None, '(UNSEEN)')
        con.close()
        con.logout()
        return float(len(msgnums[0].split()))