【Python 打开文件夹】——两种打开文件夹的方法

点个赞留个关注吧!!

第一种:

import os

start_directory = r'C:\Windows\System32'
os.system("explorer.exe %s" % start_directory)

第二种:

import os
start_directory = r'D:'
os.startfile(start_directory)

运行后:  会自动打开该文件夹

《【Python 打开文件夹】——两种打开文件夹的方法》

    原文作者:小木_.
    原文地址: https://blog.csdn.net/weixin_46625757/article/details/122972196
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞