hi guys i am trying to build an automatic converter from xlsx to csv, here is my function that converts the file
def on_modified(self, event):
print(f'event type: {event.event_type} path : {event.src_path}')
fileToConvert = pd.read_excel (event.src_path)
fileToConvert.to_csv(pathOutput)
the event object is derived from a library and it returns the desired results, pd is how i imported pandas, but when i run the code i get this error
Traceback (most recent call last):
File "C:\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Python38\lib\site-packages\watchdog\observers\api.py", line 203, in run
self.dispatch_events(self.event_queue, self.timeout)
File "C:\Python38\lib\site-packages\watchdog\observers\api.py", line 376, in dispatch_events
handler.dispatch(event)
File "C:\Python38\lib\site-packages\watchdog\events.py", line 331, in dispatch
{
File "converter.py", line 12, in on_modified
fileToConvert.to_csv(pathOutput)
File "C:\Python38\lib\site-packages\pandas\core\generic.py", line 3170, in to_csv
formatter.save()
File "C:\Python38\lib\site-packages\pandas\io\formats\csvs.py", line 185, in save
f, handles = get_handle(
File "C:\Python38\lib\site-packages\pandas\io\common.py", line 493, in get_handle
f = open(path_or_buf, mode, encoding=encoding, errors=errors, newline="")
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\isaac\\Desktop\\converter_output'
it basically gives me a permission error and i have tried running it as administrator but got the same error any help will be greatly appreciated thanks in advance