Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Enhancement - Is there a preferred way to terminate a subprocess started with sg.execute_command_subprocess()? (add a terminate process call)

未关闭
#6,373 6 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
35/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
停滞
技术栈
python

调研方向

首先查看 issue 中提到的 execute_command_subprocess 入口点以及现有的 Call Reference 和 Cookbook 部分。记录终止异步启动的子进程所支持的方式,包括一个简短的使用示例和任何相关的资源注意事项;当指南能够清楚地回答这个问题时,工作就完成了。

由索引模型根据 Issue 内容生成。

描述

enhancement Port - TK
Type of Issue (Enhancement, Error, Bug, Question)

Question


Operating System

MacOS, Linux

PySimpleGUI Port (tkinter, Qt, Wx, Web)

tkinter


Versions

Python version (sg.sys.version)

3.10.4

PySimpleGUI Version (sg.__version__)

4.60.4

GUI Version (tkinter (sg.tclversion_detailed), PySide2, WxPython, Remi)

8.6.12


Your Experience In Months or Years (optional)

3 Years Python programming experience

40 Years Programming experience overall

Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)
No

Anything else you think would be helpful?

This issue is really a documentation and recommended coding style question_ Perhaps it could be cleared by just by an explicit answer and example in the Call Reference and Cookbook.


Troubleshooting

These items may solve your problem. Please check those you've done by changing - [ ] to - [X]

  • Searched main docs for your problem www.PySimpleGUI.org
  • Looked for Demo Programs that are similar to your goal. It is recommend you use the Demo Browser! Demos.PySimpleGUI.org
  • None of your GUI code was generated by an AI algorithm like GPT
  • If not tkinter - looked for Demo Programs for specific port
  • For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.org
  • Have upgraded to the latest release of PySimpleGUI on PyPI (lastest official version)
  • Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released
Detailed Description

Hi Mike! Thank you for all you are doing for PySimpleGUI!!!_

I have a program which starts up several async processes using sg.execute_command_subprocess().

I have a PYsimpleGUI button, and when the user clicks that button, I want to terminate the subprocesses started earlier, which are still running asynchronously.

I looked through the call reference and cookbook but I did not see any corresponding sg.terminate_subprocess() function.

I was wondering if calling terminate on the object like this, rather than using a PySimpleGUI command (that I didn't find) would cause any problems with resource leaks or other problems within the PySimpleGUI object.

Code To Duplicate

Since sg.execute_command_subprocess() returns a popen_object, I can just send the terminate() message to the object like this:

import PySimpleGUI as sg

popen_object = sg.sg.execute_command_subprocess(
return_info  = popen_object.terminate()
print(return_info)
Screenshot, Sketch, or Drawing

N/A

Watcha Makin?

I'm writing a program that extracts still images from video streams of multiple camera sources.

主要语言
Python
星标
13.8k
派生
1.8k
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PySimpleGUI/PySimpleGUI 的其他 Issue

查看 PySimpleGUI/PySimpleGUI 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。