I\'m not great on all the technical terms so I\'ll do my best to explain my problem.
I\'ve written a small script to open android SDK and check for attached devices
Thanks everyone for your help. The answer was:
import os
import time
import subprocess
print 'Current Directory:', os.getcwd()
print 'Opening Android SDK...'
os.chdir('C:\\android-sdk\\platform-tools')
print 'Current Directory:', os.getcwd()
print 'Checking for connected devices:'
t = time.ctime()
# save log of time and connected devices
with open('logfile.txt', 'w') as f:
s = ('{}\n{}'.format(t, subprocess.check_output(["adb", "devices", "-l"])))
f.write(s)
print(s)