It is currently April 24th, 2024, 11:28 pm

How to call funtion on class in python with plugin

Get help with creating, editing & fixing problems with skins
mskemalfasya
Posts: 2
Joined: October 14th, 2019, 1:52 am

How to call funtion on class in python with plugin

Post by mskemalfasya »

I really wanted to make a skin using python, and there was no tutorial anywhere :-( , and I found https://github.com/adalisan/rainmeter-python. :D
and im not to know how to call function in class. :confused:

this is my script on rainmeter :

Code: Select all

[Rainmeter]
Update=1000

[MeasurePy]
Measure=Plugin
Plugin=Python
PythonHome=C:\Users\Kemal PC\AppData\Local\Programs\Python\Python36
ScriptPath=default.py
ClassName=Measure
Function=Myfunction
UpdateDivider = 60


[Measure]
Meter=String
MeasureName=MeasurePy
FontSize=20
StringStyle=Bold
FontColor=255,255,255
UpdateDivider = 60
and i want to call my function in my python script :

Code: Select all

class Measure:
  def Reload(self, rm, maxValue):
    rm.RmLog(rm.LOG_NOTICE, "Reload called")

  def Update(self):
    return 1.0

  def GetString(self):
    return 'default String'
    
  def Myfunction(self):
    return 'Function Work'

  def ExecuteBang(self, args):
    pass

  def Finalize(self):
    pass
but the result is "default string" :(

thankyou :)