I have a function that takes in a variable as an argument. That variable happens to contain a directory, also holding a bunch of txt files.
I was wondering if there is a way for that variable to be taken as a string? Not what's inside the variable, just the name of that variable. Thanks a bunch!
import glob
import pandas as pd
variable_1 = glob.glob('dir_pathway/*txt')
variable_2 = glob.glob('other_dir_pathway/*txt')
def my_function(variable_arg):
## a bunch of code to get certain things from the directory ##
variable_3 = pd.DataFrame( ## stuff taken from directory ## )
variable_3.to_csv(variable_arg + "_add_var_to_me.txt")