What do you want to save?
Add Code snippet
New code examples
-
Python 2022-01-28 19:46:06
get self file name in python
import os os.path.basename(__file__) Add solution -
Python 2022-01-28 16:30:27
python get script name
# Option 1: Works for Python 3.4 + from pathlib import Path Path(__file__).name # ScriptName.py Path(__file__).stem # ScriptName # Option 2: use `os` library import os os.path.basename(__file__) # ScriptName.py os.path.splitext(os.path.basename(... Add solution -
Python 2021-11-04 22:01:07
vs
import numpy as np import os import six.moves.urllib as urllib import sys import tarfile import tensorflow as tf import zipfile from collections import defaultdict from io import StringIO from matplotlib import pyplot as plt from PIL import Image &... Add solution