← Back to team overview

sikuli-driver team mailing list archive

[Question #288674]: appending sys.path with a relative path

 

New question #288674 on Sikuli:
https://answers.launchpad.net/sikuli/+question/288674

hi guys, im working on something and i got stuck, for now i will simplify the problem to the point which i found most suitable for my needs but i cannot get over it... 

so the short story is, i need to append sys.path by a relative path to the module i just called, i tried to append sys.path by various ways found over the internet, mostly stackoverflow, and usualy they advice of getting current path or working directory and using os.path.join() construct to join it with >> ".." << which should resemble one directory above, but it does not work. 

what i end up with, when using os.path.join("C:\", "xy", mydir", ".."), is this: "C:\xy\mydir\.." so it just takes the two dots as a string and does not handle them in any special way... i work on windows and to explain further, i need to import a module from directory level or two above... i spent 6 hours on it, i got several workarounds but this would solve it in a much nicer way and im also confused about why it does not work if it did for a lot of people... 

thank you for any hint!  

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.