How can i open and close any programm on my raspberry pi using python?
I want to open florence.desktop (Virtual Keyboard) and close it.
I have tried it with:
P = subprocess.Popen(["/usr/share/applications/florence.desktop"]
but the error message is:
Traceback (most recent call last):
File "/usr/lib/python3.7/tkinter/init.py", line 1705, in call
return self.func(*args)
File "/home/pi/Desktop/Software_1.0.2/Software/Software/Hautpprogramm/Start_Seite.py", line 588, in 
Wartungs_Button = Button(root, text="Wartungsfunktion", font=bigFont, fg ="black", bg="#D3d3d3", command=lambda: newWindow_Wartung_PW())
File "/home/pi/Desktop/Software_1.0.2/Software/Software/Hautpprogramm/Start_Seite.py", line 165, in newWindow_Wartung_PW
P = subprocess.Popen(["/usr/share/applications/florence.desktop"])
File "/usr/lib/python3.7/subprocess.py", line 775, in init
restore_signals, start_new_session)
File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/usr/share/applications/florence.desktop'
normally you should try to execute your script with sudo, but that wouldn't help here, because you're trying to run a .desktop file, that's not really a program. Try this: subprocess.Popen(["florence"])
Open Programms on Raspberry Pi using Python?