How can I use KivyMD to execute a py script and get the pid of the script?

47 views
Skip to first unread message

Dean-O Rochester

unread,
Oct 27, 2023, 8:45:39 PM10/27/23
to Kivy users support
Hi all
I have a  kivymd program where I would like to execute a python3 script and get the pid of the python3 script I execute so I can use a button in my kivyMD app to kill the process

Thanks in advance for your time
Dean-O

Robert

unread,
Oct 27, 2023, 9:46:14 PM10/27/23
to Kivy users support
This is independent of Kivy or KivyMD, check out Python's subprocess.

Running a Python script like this will not work on mobile. 

Dean-O Rochester

unread,
Oct 27, 2023, 9:48:28 PM10/27/23
to kivy-...@googlegroups.com
Hi
I am running this on a raspberry pi not mobile. 
So is this possible to get the pid of the executed script 

--
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/aZr3cIvGbIY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/066c2a05-5ce2-4091-b702-6944ce26b0een%40googlegroups.com.

elli...@cox.net

unread,
Oct 27, 2023, 9:53:13 PM10/27/23
to kivy-...@googlegroups.com

Here is something to get you started.  Use subprocess.Popen() https://docs.python.org/3/library/subprocess.html#popen-constructor to launch the child process.  It returns a Popen object, the pid attribute is the pid of the child process.  https://docs.python.org/3/library/subprocess.html#subprocess.Popen.pid

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/de5bfb04-f126-43f5-aef6-743a60e57d09n%40googlegroups.com.

Dean-O Rochester

unread,
Oct 27, 2023, 10:49:49 PM10/27/23
to kivy-...@googlegroups.com
Thanks I will give that a try. 

Dean-O

Sent from my Droid-iPodPad-Berry

On Oct 27, 2023, at 9:53 PM, elli...@cox.net wrote:


You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/aZr3cIvGbIY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/016201da0941%247ea381e0%247bea85a0%24%40cox.net.
Reply all
Reply to author
Forward
0 new messages