I want to attach the newly created csv file for emailing from inside a program. The filename is generated inside the program and stored as fname (a string). How do I use that to mention the file location?
Will this work?
def emailing(fname, attachment)
...
...
attachment = open(/home/pi/Adafruit_Python_MAX31855/%s, fname)
...
You should use,
'{}'.format()
right after the location.To know More about .format refer here. https://pyformat.info/
I suggest you learn basics of python first, before trying.