Sublime Forum

Arithmetics: Access python library

#1

Hey everyone!
Is there a way to access a python library via Arithmetics?
I’d like to call some methods from secrets:


Best wishes,
Shu

0 Likes

#2

I believe you will have to edit the arithmetic plugin to specify additional imports you want access to

0 Likes

#3

You can use the builtin __import__ function to import a module inline, eg: __import__("math").cos.

3 Likes

#4

Thanks for your replies @kingkeith and @bschaaf !
Both suggestions were quite helpful! I edited the arithmetics.py to include “(i%10) + 1” rather than “i + 1” as a standard and now got secrets.randbelow(x) running as an argument for Arithmetics from a shortcut via macro!

0 Likes