Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

get current file name python

import os
os.path.basename(__file__)
Comment

python name of current file

from pathlib import Path
print(Path(__file__).stem) #myfile
print(Path(__file__).name) #myfile.py
Comment

PREVIOUS NEXT
Code Example
Python :: traceback python 
Python :: spark dataframe get unique values 
Python :: matplotlib 3D plots reduce margins 
Python :: version of scikit learn 
Python :: matplotlib legend 
Python :: pandas sort values reset index 
Python :: pandas groupby as new column 
Python :: dataframe rank groupby 
Python :: python get all images in directory 
Python :: python clipboard to image 
Python :: brownie normalize to wei 
Python :: sort python dictionary by date 
Python :: python count repeated elements in a list 
Python :: datetime one week ago python 
Python :: how to spread an array in python 
Python :: df shift one column 
Python :: how to get data in treeview in tkiter 
Python :: mouse in pygame 
Python :: use beautifulsoup 
Python :: how to change font sizetkniter 
Python :: insta profile downloader in python 
Python :: how to make a query for not none value in django 
Python :: how to get a list of followers on instagram python 
Python :: tensorflow plot model 
Python :: run flask application in development mode stack overflow 
Python :: tkinter execute function on enter 
Python :: open a web page using selenium python 
Python :: square (n) sum 
Python :: ndarray to list 
Python :: matplotlib plot data 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =