February 2015
Intermediate to advanced
224 pages
4h 57m
English
The sys.path function is a list (did you notice the square brackets in the preceding code output?) and as such can be appended or extended to include new file paths that will point to modules the user wants to import. To avoid the need to adjust sys.path, copy the module into the site-packages folder. When this is not possible, use the sys.path.append() method instead:
>>> sys.path.append("C:\\Projects\\Requests") >>> sys.path ['', 'C:\\WINDOWS\\SYSTEM32\\python27.zip', 'C:\\Python27\\ArcGIS10.2\\Dells', 'C:\\Python27\\ArcGIS10.2\\lib', ..'C:\\Python27\\ArcGIS10.2\\lib\\plat-win', ..'C:\\Python27\\ArcGIS10.2\\lib\\lib-tk', ..'C:\\Python27\\ArcGIS10.2\\Lib\\site-packages\\pythonwin', ..'C:\\Python27\\ArcGIS10.2', ...
Read now
Unlock full access