It is currently March 29th, 2024, 5:36 am

Running python script with rainmeter

Get help with creating, editing & fixing problems with skins
dark_inspiration
Posts: 1
Joined: August 21st, 2017, 12:46 pm

Running python script with rainmeter

Post by dark_inspiration »

Hi there, I am new to rainmeter (well, personalizing it), and i have some questions if what i want is even possible, because searching google didnt really help me much.

In short; I have a simple python script that when ran fetches bus schedule data and returns how long till the next bus in the command line.

I want to have those results displayed at all time on my desktop. Is it possible to have rainmeter execute the script every x seconds in the background and show me the results?

If its possible, how would you suggest i should go about it.

Thank you for your help!


----------------------------------------------

Edit:

I managed to get everything working, but the script wont refresh the data at all, unless i manually refresh it. Here is the script:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
OnRefreshAction=[!CommandMeasure MeasureRun Run]

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=python ******
State=Hide
OutputType=ANSI
OutputFile=#CURRENTPATH#CPUName.txt

[MeterResult]
Meter=String
MeasureName=MeasureRun
Y=10R
FontSize=14
FontColor=255,255,255,255
AntiAlias=1
StringStyle=Bold
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Running python script with rainmeter

Post by mak_kawa »

You execute RunCommand which runs the python script only once at skin load/refresh. Insert following measure will help, possibly.

Code: Select all

[MeasureRunCommand]
Measure=Calc
Formula=1
IfCondition=1
IfTrueAction=[!CommandMeasure MeasureRun Run]
UpdateDivider=
Fill "UpdateDivider=" with second value of run interval as you want.