AttributeError: 模块“os”没有属性“chroot”

Ash*_*hay 5 python chroot attributeerror python-3.x

下面是我在 spyder 中运行的非常基本的代码,python 很卡,我做错了什么?

import csv,os,sys
path = os.getcwd()
print (path)
os.chroot(path)
Run Code Online (Sandbox Code Playgroud)

我收到以下错误消息:

  os.chroot(path)

AttributeError: module 'os' has no attribute 'chroot'
Run Code Online (Sandbox Code Playgroud)

Zer*_*eus 3

一种可能是您的操作系统是 Microsoft Windows,该操作系统os.chroot()不可用