Can't run generated python code
Hi, I'm trying to run compiled python code but I cannot find the "key_code" module anywhere. Sorry if this question is dumb but I've been struggling for an hour now and I can't find anything talking about this.
Did you mean this? https://github.com/repeats/Repeat/blob/master/src/staticContent/natives/python/key_code.py
The template code is here https://github.com/repeats/Repeat/blob/master/src/staticContent/natives/python/template_repeat.py
Does the default template not compile and run? What error did you see?
Oh sorry it runs on the webpage but I thought it would be possible to embed the py code in another program... Is this a possible?
This python code is run when there's a task activation trigger. You can definitely make this program interact with another program. If you tell me more about your scenario, I can let you know what you need.
In particular, you can make this program interact with another program using the following way:
- Call your program as a subprocess inside the python code.
- Send a signal to your program (via socket or HTTP if your program is a server).
- Let your program invoke this python code by setting a shared variable. A shared variable can be set using the CLI.
I wanted to generate python code to embed it in my tkinter gui (macro lib for a game) Is there really no way of running the compiled code without having the jar opened?
Unfortunately, this Repeat program is not a library, so you can't use it inside your GUI without running the jar in the background. What you're looking for is a Python library. Perhaps https://pyautogui.readthedocs.io/en/latest/ is the one that you need.
What you can do with the generated code is to convert it to using pyautogui interface, then you'll be able to run it in your program without running the jar. That said, I'm not sure why you need to generate the code in the first place? Can't you just write that code yourself (albeit being very manual)?
Close due to inactivity