-
to get the full pathname to a script that python is executing
12
import
os, sys
os.path.abspath(sys.argv[
0
])
-
list all the files in given folder
12
import
glob
glob.glob(”
/
mypath
/
*
.txt”)
-
create a folder if it does not exist
123
import
os
if
not
os.path.exists(
dir
):
os.makedir(
dir
)
Hide Comments