Skip to content
Advertisement

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 make an answer:

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 /dir or OtherClassA located in /subdirA? I tried things like: or

Relative imports for the billionth time

I’ve been here: http://www.python.org/dev/peps/pep-0328/ http://docs.python.org/2/tutorial/modules.html#packages Python packages: relative imports python relative import example code does not work Relative imports in python 2.5 Relative imports in Python Python: Disabling relative import and plenty of URLs that I did not copy, some on SO, some on other sites, back when I thought I’d have the solution quickly. The forever-recurring question is this:

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 absolute path to the directory where the templates are stored.

Advertisement