“Python Get Directory of Current Script File” Respostas de código

Python Obtenha o caminho do script

os.getcwd()
Nasty Nightingale

Python Get Directory of Current Script File

import os
os.path.abspath(__file__) # Directory of current python script
#Output will look something like: C:\Users\UserName\Desktop\py-script.py
veasman

Respostas semelhantes a “Python Get Directory of Current Script File”

Perguntas semelhantes a “Python Get Directory of Current Script File”

Mais respostas relacionadas para “Python Get Directory of Current Script File” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código