Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to find in which directory my python code is running

import os
dir_where_my_py_code_is_running = os.getcwd()
print(dir_where_my_py_code_is_running)    #prints the directory


Comment

PREVIOUS NEXT
Code Example
Python :: django collectstatic 
Python :: python password with special characters 
Python :: pandas average every n rows 
Python :: python factorial 
Python :: how to install api in python 
Python :: How to convert string date to datetime format in python 
Python :: access first element of dictionary python 
Python :: try except python not working 
Python :: pandas split dataframe into chunks with a condition 
Python :: with suppress python 
Python :: How to round to 2 decimals with Python? 
Python :: python is folder or file 
Python :: how to find highest number in list without using max function python 
Python :: how to make lists in python 
Python :: real hour in python 
Python :: python isinstance list 
Python :: seconds to datetime.time 
Python :: backtracking python 
Python :: uninstall python using powershell 
Python :: python3 shebang 
Python :: turn list in to word python 
Python :: python split string size 
Python :: python optional arguments 
Python :: Python, importing other scripts from other directories 
Python :: django active link 
Python :: class python 
Python :: new dataframe based on certain row conditions 
Python :: list comprehension 
Python :: labs fill ggplot2 
Python :: how to play and stop music python 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =