简体   繁体   中英

how do I get the name of application launched by subprocess in python?

我正在启动文本编辑器,但是对于不同的用户,默认的文本编辑器可能会有所不同,因此,如果发生错误,我如何获得仅用于处理的文本编辑器的名称,请切换到其他文本编辑器?

假设您在Linux / POSIX环境中工作,则可以使用os.environ映射读取EDITOR环境变量。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM