会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
孤独的程序员dis1500
知识就是希望
python获取工作相对路径
import os
# 查看当前工作目录
print("Current working directory:", os.getcwd())
# 如果需要切换到脚本所在的目录
script_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(script_dir)
posted on
2024-10-28 01:03
lydstory
阅读(
12
) 评论(
0
)
收藏
举报
刷新页面
返回顶部
导航
博客园
首页
新随笔
联系
订阅
管理
公告