如何编写一个可以还原cwd的装饰器?

如何编写一个可以还原cwd的装饰器?,第1张

如何编写一个可以还原cwd的装饰器?

path.py模块(如果在python脚本中处理路径,则应使用该模块)具有上下文管理器

subdir = d / 'subdir' #subdir is a path object, in the path.py modulewith subdir:  # here current dir is subdir#not anymore

(版权来自Roberto Alsina的这篇博客文章)



欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5639772.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存