Hi,
I'm wondering if there is a functionality like a dictionary (https://www.w3schools.com/python/python ... naries.asp), where I can associate a list of values with their definitions.
I'm currently using if statements to achieve this, but perhaps there is a better way? Thanks!
Functionality Like Python Dictionary
Moderators: JRL, Dorian (MJT support)
Re: Functionality Like Python Dictionary
Wow that's interesting!
Macro Scheduler doesn't have that but it does have python code execution capabilities. Have you tried that? SEE THIS Otherwise, can you show an example of what you're doing with IF> statements and maybe there are other ways to accomplish what you want to do. For example, some of the Python Dictionary functionality might be replicated using text files and SQL. Or perhaps by using JSONParse>. Or maybe by using labelToVar> then putting the list into an array using Separate> and working with the array.
I've done a little with python but not enough to be comfortable sharing. I think I'm going to see what I can do with the dictionary function. if nothing else it just looks like fun.
<After a bit of tinkering>
Here's an example from the page you provided. Be sure to read about PyExec> in the URL above. This doesn't work if the libraries are not installed.
Macro Scheduler doesn't have that but it does have python code execution capabilities. Have you tried that? SEE THIS Otherwise, can you show an example of what you're doing with IF> statements and maybe there are other ways to accomplish what you want to do. For example, some of the Python Dictionary functionality might be replicated using text files and SQL. Or perhaps by using JSONParse>. Or maybe by using labelToVar> then putting the list into an array using Separate> and working with the array.
I've done a little with python but not enough to be comfortable sharing. I think I'm going to see what I can do with the dictionary function. if nothing else it just looks like fun.
<After a bit of tinkering>
Here's an example from the page you provided. Be sure to read about PyExec> in the URL above. This doesn't work if the libraries are not installed.
Code: Select all
/*
python_code:
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
x = thisdict["model"]
*/
LabelToVar>python_code,pcode
PYExec>pcode,output,x
MDL>x
Re: Functionality Like Python Dictionary
@JRL,
Sounds like you're being rude if you read it quickly.
x = thisdict["model"]
Sorry, way too tempting. The devil made me do it.
PepsiHog
Sounds like you're being rude if you read it quickly.

x = thisdict["model"]
Sorry, way too tempting. The devil made me do it.
PepsiHog
Windows 7
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
Re: Functionality Like Python Dictionary
Thank You!
I will take a look at this and play around.
Thanks again for helping this beginner.
I will take a look at this and play around.
Thanks again for helping this beginner.