Tips for coding python scripts / plugins compatible with Linux, Mac, Windows AND Xbox
#9
BigBellyBilly Wrote:thanks for the info on ROOTDIR and I'll be changing all my code to use os.path.join as I update them for Atlantis scripting changes.

quick question, is this:
p = os.path.join('Q:','scripts',__scriptname__)

the same as

p = 'Q:\\scripts\\' + __scriptname__

in that its still from the Q: root ?
thanks

I didn't try os.path.join with more than 2 arguments, but according to the documentation, what you wrote is correct and does what you said, here is what doc says:
join( path1[, path2[, ...]])
Join one or more path components intelligently. If any component is an absolute path, all previous components (on Windows, including the previous drive letter, if there was one) are thrown away, and joining continues. The return value is the concatenation of path1, and optionally path2, etc., with exactly one directory separator (os.sep) inserted between components, unless path2 is empty. Note that on Windows, since there is a current directory for each drive, os.path.join("c:", "foo") represents a path relative to the current directory on drive C: (c:foo), not c:\\foo.

Other than that sorry I didn't opened an ticket yet since I don't have ogs for Linux (I don't have currently Linux PC)
Reply


Messages In This Thread
Great but... - by Gamester17 - 2008-09-08, 22:48
[No subject] - by jmarshall - 2008-09-08, 22:57
[No subject] - by Temhil - 2008-09-08, 23:30
[No subject] - by jmarshall - 2008-09-08, 23:35
[No subject] - by Gamester17 - 2008-09-09, 10:33
[No subject] - by blittan - 2008-09-09, 23:48
[No subject] - by BigBellyBilly - 2008-09-12, 12:23
[No subject] - by Temhil - 2008-09-13, 00:44
[No subject] - by BigBellyBilly - 2008-09-13, 09:54
FIXED in XBMC Beta1 - by Temhil - 2008-10-07, 01:25
[No subject] - by Nuka1195 - 2008-10-07, 01:51
[No subject] - by blittan - 2008-10-07, 08:40
[No subject] - by CrashX - 2009-02-16, 05:11
[No subject] - by CrashX - 2009-02-17, 02:51
[No subject] - by BigBellyBilly - 2009-02-17, 13:24
[No subject] - by Nuka1195 - 2009-02-17, 15:33
[No subject] - by BigBellyBilly - 2009-02-17, 15:36
[No subject] - by plex - 2011-12-06, 12:47
Logout Mark Read Team Forum Stats Members Help
Tips for coding python scripts / plugins compatible with Linux, Mac, Windows AND Xbox2