View Single Post
Old 01-31-2025, 11:00 AM   #1423
Nicolas.Laurent
Member
Nicolas.Laurent began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jun 2016
Location: France
Device: PocketBook Touch Lux 2
Hello everyone.
And sorry in advance for any linguistic errors, English is not my mother tongue.

I'm looking to retrieve the value of a variable obtained using an input box. From the following code, in the 'Run Python Code' module, I manage to enter a value, but I don't know how to assign it to a variable for use in subsequent instructions.

from PyQt5.QtWidgets import QInputDialog

def run(gui, settings, chain):
gui = chain.gui
text, ok = QInputDialog.getText(gui, “Input”, “Enter your text:”)
if ok and texte:
my_input=text
return True
pass

I've tried using the 'Chain Variable' module, but the code doesn't work. I'd be grateful for any help I can get in solving this problem for a new user of the Action Chains plugin (incredible, by the way).
Nicolas.Laurent is offline   Reply With Quote