I have python script that saves the log file and another csv to a relative resource path. The pyinstaller throws file not found error. The file structure of code is.
<code>-ProjectFolder
|-common
| |- commom.py
|-src
| |- main.py
| |- anotherclass.py
|-resources
| |-output.logs
| |-result.csv
</code>
<code>-ProjectFolder
|-common
| |- commom.py
|-src
| |- main.py
| |- anotherclass.py
|-resources
| |-output.logs
| |-result.csv
</code>
-ProjectFolder
|-common
| |- commom.py
|-src
| |- main.py
| |- anotherclass.py
|-resources
| |-output.logs
| |-result.csv
Output exe directory
<code>-ProjectFolder
|-output
| |-main
| | |-main.exe
| | |-_internal
| | | |-tons of packages and resources folder if I pass it while creating installer
</code>
<code>-ProjectFolder
|-output
| |-main
| | |-main.exe
| | |-_internal
| | | |-tons of packages and resources folder if I pass it while creating installer
</code>
-ProjectFolder
|-output
| |-main
| | |-main.exe
| | |-_internal
| | | |-tons of packages and resources folder if I pass it while creating installer
How do I get this output to a folder besides the main folder of the executable?
<code>FileNotFoundError: [Errno 2] No such file or directory: 'D:\Projects\CapstoneProject-Outkits\output\resources\outkitsapicall.log'
</code>
<code>FileNotFoundError: [Errno 2] No such file or directory: 'D:\Projects\CapstoneProject-Outkits\output\resources\outkitsapicall.log'
</code>
FileNotFoundError: [Errno 2] No such file or directory: 'D:\Projects\CapstoneProject-Outkits\output\resources\outkitsapicall.log'
Code inside main.py
<code>file_handler = logging.FileHandler('../resources/outkitsapicall.log', mode='w', encoding='utf-8')
</code>
<code>file_handler = logging.FileHandler('../resources/outkitsapicall.log', mode='w', encoding='utf-8')
</code>
file_handler = logging.FileHandler('../resources/outkitsapicall.log', mode='w', encoding='utf-8')