Obtener directorio de trabajo python

Ejemplos de código

24
0

obtener wd en python

import os

path = os.getcwd()

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

print(type(path))
# <class 'str'>
17
0

obtener directorio de trabajo python

import os
os.getcwd()
15
0

directorio de trabajo python

import os
cwd = os.getcwd()
8
0

python obtener directorio actual

import os

print(os.getcwd())
7
0

os obtener directorio actual

import os

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

#Change the Current working Directory
os.chdir('/home/varun')
4
0

obtener el directorio de trabajo actual python

# print current working directory in python
import os
cwd = os.getcwd()
print(cwd)

En otros idiomas

Esta página está en otros idiomas

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................