Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python get full path

import os
# you have to be in the same directory as the file
file = 'myfile.txt'
# or also
file = 'directory/to/myfile.txt'

path = os.path.abspath(file)
Comment

PREVIOUS NEXT
Code Example
Python :: object to int64 pandas 
Python :: list files in s3 folder python 
Python :: python reimport module 
Python :: python how to write pandas dataframe as tsv file 
Python :: python read string between two substrings 
Python :: python delete contents of file 
Python :: plot keras model 
Python :: make a list from 0 to n python 
Python :: selenium driver wait python 
Python :: how to split and keep delimiter at the same line in python 
Python :: hide root window tkinter 
Python :: python selenium select dropdown 
Python :: python get absolute path of file 
Python :: python pip graphviz 
Python :: pandas plotly backend 
Python :: drop rows that contain null values in a pandas dataframe 
Python :: beuatiful soup find a href 
Python :: create a directory python 
Python :: plt vertical line 
Python :: python generate dates between two dates 
Python :: python get time of day 
Python :: python mean and standard deviation of list 
Python :: Generate random image np array 
Python :: how can I sort a dictionary in python according to its values? 
Python :: how to get the size of an object in python 
Python :: get website content with beautifulsoup 
Python :: python get user home directory 
Python :: print first dictionary keys python 
Python :: delete unnamed 0 columns 
Python :: how to get ipconfig from python 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =