Directories in xbmx/python - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: Directories in xbmx/python (/showthread.php?tid=23496) |
Directories in xbmx/python - jepper - 2006-12-03 i have some strange problems with saving files to the disk so i have some questions: 1) can a python script save a file anywhere on the disk? 2) what should the path look like ( end slash or not etc etc, for example the script home directory and then in the mp3 map)? im having some strange problems with it, i can save in partition roots but not in subfolders. i can sometimes save in my script homedir and subfolder etc etc - Rockstarr - 2006-12-03 Hi. I'm not sure if I understood you right. You dont know how to save a file via python? Example Code: Code: f = open('Q:\\your\\path\\file.ext', 'w') - jepper - 2006-12-04 i do know how to save files, but i get problems with the path i've written this, with a progress bar and stuff Quote: url = resultaat[s] - jepper - 2006-12-04 so the problem is not with the code but how to format the download path - Nuka1195 - 2006-12-04 use: dest = os.path.join( downloadpath, naam + ".mp3") do NOT include ending \ in the downloadpath though i don't see where you define downloadpath or naam. - jepper - 2006-12-04 naam is the song name download path is set outside of this class as a global (sorry for that) but its Q:\scripts\OMplayer\mp3\ so i think that is the problem (end slash) thanx - Nuka1195 - 2006-12-04 Q:\\scripts\\OMplayer\\mp3 you need to escape a backslash. Also with using os.path.join(), my sentence should have read you do NOT need to include the ending backslashes. |