Dear people of the internet, I need some help...
I have a Python script, main.py in which a user can enter 2 variables
First, ReminderTime is an int, second, ReminderText is a string. I want to send the two variables to another Python script, reminder.py.
The reminder script will do stuff with the two objects, and then it will use ToastNotifier to make a Windows notification, before shutting down.
The main script will still run in the foreground during that time. Is this possible?
Add a comment
|
1 Answer
You can use multiprocessing
Simple example:
p = Process(target=f, args=(ReminderTime, ReminderText))
p.start()
f - is function in your reminder.py that will start that script (like main in main.py by default)
args - is all arguments you need to send to this function
Also, you need to import you function import reminder.function_name
This code will start you f function in background, so main code will still runing.
2 Comments
Vuk Bajić
It doesn't quite work, the reminder.py script doesn't run at all
gook
@VukBajić, Can you show me your code? Use pastebin.com or equivalent.