ERROR: Could not find a version that satisfies the requirement os
时间: 2023-09-22 09:10:41 浏览: 141
`os` is a built-in module in Python, so you don't need to install it separately. You can directly use it in your code. Here's an example:
```python
import os
# Get the current working directory
current_dir = os.getcwd()
print("Current directory:", current_dir)
# Create a new directory
new_dir = os.path.join(current_dir, "new_directory")
os.mkdir(new_dir)
print("New directory created:", new_dir)
# Change directory
os.chdir(new_dir)
print("Current directory changed to:", os.getcwd())
# List files in the current directory
files = os.listdir()
print("Files in the current directory:", files)
```
In this example, we import the `os` module and use its functions to perform operations such as getting the current working directory, creating a new directory, changing the current directory, and listing files in the current directory.
阅读全文