python script to check if a file is present
#1
Brick 
Hi everyone,

Big shout out to Enen92 and Curti for the help so far. Cheers Guys!

Ok so I want to write a Python script to check if a Folder Is Present in A directory

Can someone point me in the right direction please,

Thank you.
Reply
#2
http://mirrors.kodi.tv/docs/python-docs/...ml#-exists
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#3
you can check if a file or folder exists with our xbmcvfs module:
http://mirrors.xbmc.org/docs/python-docs...ml#-exists
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#4
(2015-05-16, 00:57)Martijn Wrote: http://mirrors.kodi.tv/docs/python-docs/...ml#-exists

Thanks Martijn,

Im sure I read a blog of yours about making an addon and avoiding mistakes, was that you?? It has a history of code and asciii and utf-8 problems. very interesting.
Reply
#5
(2015-05-16, 00:59)ronie Wrote: you can check if a file or folder exists with our xbmcvfs module:
http://mirrors.xbmc.org/docs/python-docs...ml#-exists

cheers Ronie, Just making dinner. Ill take a look in a short while. Thank you for the quick reply.
Reply
#6
Here are two examples on hwo to check that a file exists with python 2 and -> https://tutorials.technology/tutorials/0...ython.html
Reply
#7
python:
import os
dirname = "temp"
#check directory exists
if(os.path.exists(dirname)):
print("Directory Exists")
else:
print("Directory does not exists")

more on...folder exists
Reply

Logout Mark Read Team Forum Stats Members Help
python script to check if a file is present0