Mar-31-2018, 05:47 PM
Hey guys I can get this to run on android but I can get it to run on Windows when I change the path can u guys help please. I do need and explanation so I can learn though
Cheers
Nathan
...........................
Sorry it didnt come up as sorce i incased it wrong
Cheers
Nathan
...........................
import os import shutil #change the pathway were to sort path ="/internalsharedstorage/downloads/" name = os.listdir(path) folder_name = ['image','text','exe','mp3','mp4','apk','pdf','zip','rar','sav'] for x in range(0,10): if not os.path.exists(path+folder_name[x]): os.makedirs(path+folder_name[x]) # movement of files for files in name: if '.pdf' in files and not os.path.exists(path+'pdf/'+files): shutil.move(path+files, path+'pdf/'+files) elif '.zip' in files and not os.path.exists(path+'zip/'+files): shutil.move(path+files, path+'zip/'+files) elif '.exe' in files and not os.path.exists(path+'exe/'+files): shutil.move(path+files, path+'exe/'+files) elif '.jpeg' in files and not os.path.exists(path+'image/'+files): shutil.move(path+files, path+'image/'+files) elif '.txt' in files and not os.path.exists(path+'text/'+files): shutil.move(path+files, path+'text/'+files) elif '.mp3' in files and not os.path.exists(path+'music/'+files): shutil.move(path+files, path+'music/'+files) elif '.sav' in files and not os.path.exists(path+'save/'+files): shutil.move(path+files, path+'sav/'+files) elif '.rar' in files and not os.path.exists(path+'rar/'+files): shutil.move(path+files, path+'rar/'+files) elif '.mp4' in files and not os.path.exists(path+'mp4/'+files): shutil.move(path+files, path+'mp4/'+files) elif '.apk' in files and not os.path.exists(path+'apk/'+files): shutil.move(path+files, path+'apk/'+files) else: print ('cant be moved')
Sorry it didnt come up as sorce i incased it wrong