“CWD Python” Respostas de código

Obtenha WD em Python

import os

path = os.getcwd()

print(path)
# /Users/mbp/Documents/my-project/python-snippets/notebook

print(type(path))
# <class 'str'>
Happy Hawk

CWD Python

import os
cwd = os.getcwd()
Happy Hawk

OS obtém diretório atual

import os

#Get Current working Directory
currentDirectory = os.getcwd()

#Change the Current working Directory
os.chdir('/home/varun')
Agreeable Alpaca

Obtenha o diretório de trabalho Python

import os
os.getcwd()
Outrageous Opossum

Respostas semelhantes a “CWD Python”

Perguntas semelhantes a “CWD Python”

Mais respostas relacionadas para “CWD Python” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código