Skip to content

Tag: relative-path

Add date object in a relative path?

I’m currently trying to create PDF from Excel file in Python, with the hour and date of creation of the PDF on the name’s file. But I’m stuck with the relative path: How could I add a date object in my relative path? Just below part of my code. Answer Based on your comment I’ll try to …

Python imports relative path

I’ve got a project where I would like to use some python classes located in other directories. Example structure: The absolute path varies, because this project is run on different machines. When my python file with MySampleClass located in /mydir is executed, how do I import OtherClassRoot located in /…

Relative paths in Python [duplicate]

This question already has answers here: How do you properly determine the current script directory? (16 answers) Closed 6 months ago. I’m building a simple helper script for work that will copy a couple of template files in our code base to the current directory. I don’t, however, have the absolut…